alsa-sound: AudioSessionOut synchronization fixes

- Modify synchronization between AudioSink and EventThread
- Move the code block related to drain to a different function
- Reset EOS flags in write()
- Do not depend on the filled queue size to set mReachedEOS

Change-Id: Ie8cd7b9ff9cab495f236f2cfa9c68a9f3a204fe4
CRs-Fixed: 439892
audio: update device for all outputs in setPhoneState

- Change routing for all outputs is nessary in setPhoneState
  Update devices not only for primary outputs but also other
  outputs including direct, tunnel, HDMI and so on

Change-Id: I4861e67c8aab9e39f83386c27b9a9e167befd347
CRs-Fixed: 438651
 Fix for MT call ringtone on USB headset

- Issue:when usb headset connected MT call ringtone heard
  only on speaker and expected behaviour is ringtone should
  be heard on both speaker and usb headset.
- Fixed by defining combo device usb proxy rx speaker

Change-Id: I0474651ed6fa40636038dcd7b25c7962cecc7239
CRs-Fixed: 443227
audio: fix for audio recording

- Read SSR system prop only for surround
  sound recording use case.
- Change input buffer size for 8974 to 512 bytes

Change-Id: I70064769e92149cb6675a92018fb35533900e65f
alsa-sound : Fix a deadlock

- openOutputStream() deletes an object of type AudioSessionOut
  if the object initialization fails.
- This leads to a deadlock as the AudioSessionOut::reset() tries
  to acquire the same lock held by openOutputStream.
- Release the lock in openOutputStream before deleting the
  AudioSessionOut object.

Change-Id: If763eded702a59828ae51adfa4dca23749bd7300
CRs-Fixed: 442365