audioflinger: Fix to prevent deadlock in AudioEffects

-Write is blocked waiting for effect chain lock and this causes
decoder thread to wait indefintely.
-Sometimes it is observed that effectschain is locked before
mLPAEffectChain is initialized and but unlocking is skipped if
mLPAEffectChain is initialized in between.Due to this LPA
silence and framework reboot issues are observed as
applyEffectsOn() cannot acquire lock to progress further.
-Use flag to check if all effects have been locked and unlock
accordingly to prevent the deadlock scenario.

Change-Id: Iaedb03c05406e79ef0eadbf2ae4681ba9fe0f3c3
CRs-Fixed: 524759

Conflicts:
	services/audioflinger/Threads.cpp
Merge "audioflinger: Fix to prevent deadlock in AudioEffects" into jb4.3