Keymaster memory management is inconsistent

Objects derived from RefBase should always be owned by sp rather then
unique_ptr or other smart pointer implementations.

Bug: 79474587
Change-Id: I6a3ca04b3a3bab74c6114643ffdaeac537188d12
diff --git a/Android.bp b/Android.bp
index f565732..a4cbd88 100644
--- a/Android.bp
+++ b/Android.bp
@@ -230,6 +230,7 @@
         "libhidlbase",
         "libhwbinder",
         "libkeymaster4support",
+        "libutils",
     ],
 }
 
diff --git a/Keymaster.h b/Keymaster.h
index 42a2b5d..9a0616d 100644
--- a/Keymaster.h
+++ b/Keymaster.h
@@ -115,7 +115,7 @@
     bool isSecure();
 
   private:
-    std::unique_ptr<KmDevice> mDevice;
+    sp<KmDevice> mDevice;
     DISALLOW_COPY_AND_ASSIGN(Keymaster);
     static bool hmacKeyGenerated;
 };