audioflinger: check for condition before waiting

AsyncCallbackThread must check for any condition that
was already been satisfied before waiting.

CRs-Fixed: 581978
Change-Id: I7a37c03cddcf7fdaa61c826d71a4d527979ce9e1
libstagefright: Delay release of wakelock

Delay release of wakelock till the last event
in the event queue of TimedEventQueue has been processed.
This ensures AP shutdown does not happen while an event
is ready but hasn't been processed yet.

CRs-Fixed: 583053
Change-Id: I597c0b9887b02b070c708401e5f3c40a0a2289d0
disable camera sounds (3/3)

Change-Id: I3540e652cdc5601dd5ea83a314b96f98d0cd9917