Add ota_close(unique_fd&) and ota_fclose(std::unique_ptr<FILE>&).

We were using the below sequence prior to the CL in [1].

unique_fd fd(ota_open(...));
ota_close(fd);
fd.reset(ota_open(...));

fd.reset() may unintentionally close the newly opened FD if it
has the same value as the early ota_open. The CL in [1] changed to
"ota_close(fd.release())" to avoid the issue. This CL adds a new
overloaded function ota_close(unique_fd&) to handle the release
automatically.

Similarly add ota_fclose(std::unique_ptr<FILE>&).

[1] commit 48cf770471ef53fbf0a1837196220862a0bdb18d.

Bug: 33034669
Test: recovery_component_test passes.
Change-Id: Ief91edc590e95a7426e33364b28754173efb1056
diff --git a/otafault/ota_io.h b/otafault/ota_io.h
index e119eef..45d17b1 100644
--- a/otafault/ota_io.h
+++ b/otafault/ota_io.h
@@ -26,6 +26,8 @@
 #include <stdio.h>
 #include <sys/stat.h>
 
+#include <memory>
+
 #include <android-base/unique_fd.h>
 
 #define OTAIO_CACHE_FNAME "/cache/saved.file"
@@ -60,4 +62,8 @@
 
 using unique_fd = android::base::unique_fd_impl<OtaCloser>;
 
+int ota_close(unique_fd& fd);
+
+int ota_fclose(std::unique_ptr<FILE, int (*)(FILE*)>& fh);
+
 #endif