Re-init battery listener when Health hal died

When system_server and health hal both died, battery listener
will get blocked in serviceDied. Make complete cleanup
for re-init.

Bug: 159429172
Test: build pass, basic function pass
Change-Id: I7ecc5b2e6e2aeb1e79ed45db94b05662eb9f37b9
CRs-fixed: 2640795
diff --git a/android/utils/battery_listener.cpp b/android/utils/battery_listener.cpp
index e9aa5d5..6f553b6 100644
--- a/android/utils/battery_listener.cpp
+++ b/android/utils/battery_listener.cpp
@@ -187,7 +187,7 @@
     {
         std::lock_guard<std::mutex> _l(mLock);
         if (mHealth != NULL)
-            mHealth->unlinkToDeath(this);
+            mHealth->unregisterCallback(this);
             auto r = mHealth->unlinkToDeath(this);
             if (!r.isOk() || r == false) {
                 LOC_LOGe("Transaction error in unregister to HealthHAL death: %s",
@@ -210,6 +210,8 @@
         LOC_LOGi("health service died, reinit");
         mDone = true;
     }
+    mHealth = NULL;
+    mCond.notify_one();
     mThread->join();
     std::lock_guard<std::mutex> _l(mLock);
     init();