wifi: Call terminate for the clean up before shutdown IPC

The hostapd_hidl_deinit will shutdown IPCThreadState.
If shutdown IPCThreadState during executing callback via IPC(HIDL),
It will cause hostapd crashed. (It will NOT cause function error but it
still be detected by log parser).

Root cause:
Some reasons causes eloop terminate, it wasn't triggered from HIDL
terminate call. Thus the callback_ doesn't clean up.

Solution: Call terminate for the clean up before shutdown IPC.

Bug: 173605884
Test: Manual Test, hotspot works normally
Test: Add test code to terminate eloop via set property. It will meet
the crash. And verify the patch fix the issue.
Test: atest VtsHalWifiHostapdV1_3TargetTest
Test: atest VtsHalWifiHostapdV1_2TargetTest
Test: atest VtsHalWifiHostapdV1_1TargetTest
Test: atest VtsHalWifiHostapdV1_0TargetTest

Change-Id: Ied413eb8819835ca421f41bc81bbfa67b04e023a
diff --git a/hostapd/hidl/1.3/hidl.cpp b/hostapd/hidl/1.3/hidl.cpp
index 68e4d86..8481908 100644
--- a/hostapd/hidl/1.3/hidl.cpp
+++ b/hostapd/hidl/1.3/hidl.cpp
@@ -62,7 +62,9 @@
 
 void hostapd_hidl_deinit(struct hapd_interfaces *interfaces)
 {
-	wpa_printf(MSG_DEBUG, "Deiniting hidl control");
+	wpa_printf(MSG_INFO, "Deiniting hidl control");
+	// Before hidl init, make sure call terminate to clear callback_
+	service->terminate();
 	eloop_unregister_read_sock(hidl_fd);
 	IPCThreadState::shutdown();
 	hidl_fd = -1;