Fix race condition between ProducerQueue dequeue and ConsumerQueue dequeue newly allocated buffer.

The original check allows newly added consumer to acquire after
LocalGain but before remote gain.

Test: all tests still pass.
Bug: 119112218

Change-Id: Iea0ae431b211ce4a539e4db64ea72411028e080a
1 file changed