Smith, Cecil, 1772-1813, Indian civil servant