libaudiohal@aidl: Synchronize commands sending

Although FMQs implement thread-safe blocking reads and
writes, using two queues (one for sending a command,
another for receiving a reply) is not an atomic operation
by itself. Add synchronization for this pair of operations
so that they work as intended.

Bug: 333116473
Test: play notification sounds in parallel with music
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:914339da0b5146690758c6bafbde6c921fa1e6d9)
Merged-In: Ia29c6c4698499acc600f9b6fe02befddd5de5326
Change-Id: Ia29c6c4698499acc600f9b6fe02befddd5de5326
2 files changed