Fix UAF problem in wificond

This is a security upstream patch.

Bug: 175124730
Test: Verified the crash in rvc-qpr-dev using poc.cpp and test
instructions provided in the bug and verified the fix works.

Change-Id: Iabccac7f9fbed9d856bee41c5443e3b8479c3e62
Merged-In: Iabccac7f9fbed9d856bee41c5443e3b8479c3e62
(cherry picked from commit fae786e5bbc4adfbe5239b3bb3df0cd6122283a6)
(cherry picked from commit 67d87a0e7e2213959f505e6a355c50079b062037)
diff --git a/main.cpp b/main.cpp
index e5e41aa..0c17edf 100644
--- a/main.cpp
+++ b/main.cpp
@@ -124,11 +124,11 @@
   android::wificond::NetlinkUtils netlink_utils(&netlink_manager);
   android::wificond::ScanUtils scan_utils(&netlink_manager);
 
-  unique_ptr<android::wificond::Server> server(new android::wificond::Server(
+  android::sp<android::wificond::Server> server(new android::wificond::Server(
       unique_ptr<InterfaceTool>(new InterfaceTool),
       &netlink_utils,
       &scan_utils));
-  RegisterServiceOrCrash(server.get());
+  RegisterServiceOrCrash(server);
 
   WifiKeystoreHalConnector keystore_connector;
   keystore_connector.start();