MacDowall, Hay, active 1790-1820, Major-General