hal: spkr_prot: release adev lock during sleep

During speaker thermal calibration, read speaker temperature
5 times with one second sleep time with adev lock acquired.
If any playback starts during that time, it will wait for
adev lock till temperature reading is done. Unblock the
playback thread by release the adev lock during sleep.

Change-Id: I383248d9a701a98c776ca019b628adc22a145e60
diff --git a/hal/audio_extn/spkr_protection.c b/hal/audio_extn/spkr_protection.c
index 53cca7d..5d35969 100644
--- a/hal/audio_extn/spkr_protection.c
+++ b/hal/audio_extn/spkr_protection.c
@@ -775,7 +775,11 @@
                                     break;
                                 }
                                 t0_spk_prior = t0_spk_1;
+                                pthread_mutex_unlock(&adev->lock);
                                 sleep(1);
+                                pthread_mutex_lock(&adev->lock);
+                                if (is_speaker_in_use(&sec))
+                                    break;
                             } else {
                                ALOGE("%s: read fail for %s err:%d\n", __func__, wsa_path, ret);
                                break;
@@ -817,7 +821,11 @@
                                     break;
                                 }
                                 t0_spk_prior = t0_spk_2;
+                                pthread_mutex_unlock(&adev->lock);
                                 sleep(1);
+                                pthread_mutex_lock(&adev->lock);
+                                if (is_speaker_in_use(&sec))
+                                    break;
                             } else {
                                ALOGE("%s: read fail for %s err:%d\n", __func__, wsa_path, ret);
                                break;