adb/base: allow use of unique_fd inside adb.

adb implements its own file descriptor emulation layer on Windows,
which requires the use of adb_close instead of close throughout the
codebase. Add a template argument to unique_fd that allows for this.

Bug: http://b/28347842
Change-Id: I6397261f4973d49f2f8e04257bf67b348585bb63
diff --git a/adb_utils.h b/adb_utils.h
index abf481b..22eb4d2 100644
--- a/adb_utils.h
+++ b/adb_utils.h
@@ -20,6 +20,7 @@
 #include <string>
 
 #include <android-base/macros.h>
+#include <android-base/unique_fd.h>
 
 void close_stdin();
 
@@ -51,6 +52,14 @@
                                std::string* error);
 
 // Helper to automatically close an FD when it goes out of scope.
+struct AdbCloser {
+    static void Close(int fd) {
+        adb_close(fd);
+    }
+};
+
+using unique_fd = android::base::unique_fd_impl<AdbCloser>;
+
 class ScopedFd {
   public:
     ScopedFd() {