I think I have found John's death registration on the Scotland's People website. No wife's name is given but the informant was William Dickie, brother-in-law.
John and Margaret are registered at the same address in the 1841 census.
John and Margaret are registered at the same address in the 1841 census.