Fix a deadlock in emulator HAL implementation

Before this change, a start() call will wait for previous threads to
finish. However, in ListenerMultiplexer.java in the framework, start(),
stop(), and deliverListener() calls are contending for the same lock.
Therefore, if a waiting start() is holding the lock, while the
almost-finishing thread is also going to hold that lock for calling
deliverListener(), a deadlock will happen.

This CL moves the waiting logic into the new thread of the start() call,
so that start() will return immediately. The new thread will wait for
the old thread to finish, and then start the actual work.

Bug: 299563185
Test: atest CtsLocationGnssTestCases
Change-Id: Ic2993a6d82c24688fa98d26d336c85518c683cf6
diff --git a/gnss/aidl/default/GnssNavigationMessageInterface.h b/gnss/aidl/default/GnssNavigationMessageInterface.h
index b335348..e9a7536 100644
--- a/gnss/aidl/default/GnssNavigationMessageInterface.h
+++ b/gnss/aidl/default/GnssNavigationMessageInterface.h
@@ -40,7 +40,7 @@
 
     std::atomic<long> mMinIntervalMillis;
     std::atomic<bool> mIsActive;
-    std::thread mThread;
+    std::vector<std::thread> mThreads;
     std::vector<std::future<void>> mFutures;
     ::android::hardware::gnss::common::ThreadBlocker mThreadBlocker;