Palmer, William, 1740-1816, Lieutenant-General