AudioFlinger: Remove unwanted update of track generation

PlaybackThread::threadLoop unncessarily updates the track generation
before waiting for a pending aync write. This is unncessary and
leads to excess calls to the power manager service for updating
uids.

Change-Id: I1284d79da3be6495acb19a97c81b3ab8db6dbb12
(cherry picked from commit f10fdf3ac4aced7d64bd0d1f05cc886271436685)
(cherry picked from commit 48568df4edf4d9b98c4d05bcfae3770c91f3be7f)
AudioTrack: Fix for race condition

This fixes a race condition between releaseBuffer and flush.

An AudioTrack::releaseBuffer() can be delayed (pre-empted) by
AudioTrack::pause/flush() and ServerProxy::obtainBuffer() calls leading
to a situation where an incorrect position is copied to the cblk

<<Change to be tested>>

Change-Id: I70074d4824ba8c7fa86c9f9ef8cc182de9172ab9
(cherry picked from commit ec237ff01ca194bf0e29933f916a30b8f83c8ace)
(cherry picked from commit 6984cd7b9e99ffa48872cf9316c68d5ae51ad3c5)