Use unique_fd for usableProgram

Makes 2 lines out of 4.

Test: TH
Change-Id: I5e2d047105065a189e6393a8f5fcb75ff42922ec
diff --git a/bpf/syscall_wrappers/include/BpfSyscallWrappers.h b/bpf/syscall_wrappers/include/BpfSyscallWrappers.h
index 3c4bc6e..a31445a 100644
--- a/bpf/syscall_wrappers/include/BpfSyscallWrappers.h
+++ b/bpf/syscall_wrappers/include/BpfSyscallWrappers.h
@@ -28,6 +28,7 @@
 namespace bpf {
 
 using ::android::base::borrowed_fd;
+using ::android::base::unique_fd;
 
 inline uint64_t ptr_to_u64(const void * const x) {
     return (uint64_t)(uintptr_t)x;
@@ -182,10 +183,8 @@
 }
 
 inline bool usableProgram(const char* pathname) {
-    int fd = retrieveProgram(pathname);
-    bool ok = (fd >= 0);
-    if (ok) close(fd);
-    return ok;
+    unique_fd fd(retrieveProgram(pathname));
+    return fd.ok();
 }
 
 inline int attachProgram(bpf_attach_type type, const borrowed_fd& prog_fd,