Merge "Simplify AudioTrack event handling and fix a race"