Cotton, Sydney John, Sir, 1792-1874, Knight, army officer