Thomas Luke (1776–1832), Bailie of Perth