audio/msm8660: Fix native crash during rapid seek operations

- Native crashes are observed during rapid seek, next and previous
  song switch operations
- There is some race condition between write and flush which results
  in adding a buffer multiple times to empty queue. This tries to
  free the buffer multiple times during reset and results in native
- Fix this issue by adding proper mutex in write and flush calls
  which synchronizes these operations and avoids crashes

CRs-Fixed: 450172
(cherry picked from commit a4413c7646320169bca133d1e7b32598ed4baa02)

Change-Id: I530d4018b221b57ec325dbe40b670ef49007aaa9
1 file changed
tree: c8ce8e4811edce4b586198aa8af97b63851d3d1b
  1. alsa_sound/
  2. audiod/
  3. libalsa-intf/
  4. mm-audio/
  5. msm7x30/
  6. msm8660/