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
1 file changed