audio: "audio_hw_unload_interface" failed to exit. [1/1]

PD#OTT-70526

Problem:
There is a problem with the timing of internal
function calls.

Solution:
Adjust the internal call timing of the function.

Verify:
zapper

Change-Id: I6336bc10b1f1b89283b4e3c72319a9f4bb6f2874
Signed-off-by: haiyang.ren <haiyang.ren@amlogic.com>
diff --git a/audio_hal/audio_hw.c b/audio_hal/audio_hw.c
index 34033db..6117b46 100644
--- a/audio_hal/audio_hw.c
+++ b/audio_hal/audio_hw.c
@@ -8230,6 +8230,12 @@
         aml_audio_delay_deinit();
     }
 #endif
+#ifdef NO_SERVER
+    adev->audio_debug_thread_exit = true;
+    if (adev->audio_debug_thread) {
+        pthread_join(adev->audio_debug_thread, NULL);
+    }
+#endif
 #ifdef ENABLE_AEC_APP
     release_aec(adev->aec);
 #endif
@@ -8245,12 +8251,6 @@
     aml_audio_debug_malloc_close();
     aml_audio_debug_close();
 
-#ifdef NO_SERVER
-    adev->audio_debug_thread_exit = true;
-    if (adev->audio_debug_thread) {
-        pthread_join(adev->audio_debug_thread, NULL);
-    }
-#endif
     ALOGD("%s:  exit", __func__);
     return 0;
 }