Fix race condition when streaming MP2TS to media server
Jean-Michel Trivi authored
Data transfer between user space and the media server of MP2TS
 packets is done through a queue of buffers. This queue tells
 the OpenMAX AL player whenever a buffer is available to be filled
 so it can be transferred.
 When the player is destroyed, this queue is cleared; this is
 indicated by the boolean mBuffersHasBeenSet whose role is to
 store whether the queue is properly configured.
There is a race condition where the queue could be cleared right
 as the availability of a buffer is signaled.
The fix is to only try to use the available buffer when
 mBuffersHasBeenSet is true.

Bug 6971102

Change-Id: Ibbe8f58fc954b84bf560f29944d1018dab261895
4a4c7289