Douglas, George, of Parkheid, Captain of Edinburgh Castle