Use raw pointer instead of shared_ptr

Throughout update_engine, there are many places we pass a shared_ptr of
FileDescriptor, for memory safety. But in many cases, functions only
need to use the pointer througout execution of the function, and do not
need to store these pointers. In these cases, it's perfectly safe to use
a raw pointer. Furthermore, the overuse of shared_ptr make life time of
FileDescriptors unpredictable. This is harmful in context of VABC, where
presence of a file descriptor can cause UnmapAllPartitions() to fail.
Therefore, we switch some of the safe usecases to raw pointer.

Test: th
Bug: 216391325
Change-Id: I3d986688e81fcc1d761b7f4926a3c81ac691788a
diff --git a/payload_consumer/filesystem_verifier_action.h b/payload_consumer/filesystem_verifier_action.h
index 850abda..edc8e53 100644
--- a/payload_consumer/filesystem_verifier_action.h
+++ b/payload_consumer/filesystem_verifier_action.h
@@ -86,13 +86,11 @@
 
  private:
   friend class FilesystemVerifierActionTestDelegate;
-  void WriteVerityAndHashPartition(FileDescriptorPtr fd,
-                                   const off64_t start_offset,
+  void WriteVerityAndHashPartition(const off64_t start_offset,
                                    const off64_t end_offset,
                                    void* buffer,
                                    const size_t buffer_size);
-  void HashPartition(FileDescriptorPtr fd,
-                     const off64_t start_offset,
+  void HashPartition(const off64_t start_offset,
                      const off64_t end_offset,
                      void* buffer,
                      const size_t buffer_size);
@@ -138,7 +136,7 @@
 
   // If not null, the FileDescriptor used to read from the device.
   // verity writer might attempt to write to this fd, if verity is enabled.
-  FileDescriptorPtr partition_fd_;
+  std::unique_ptr<FileDescriptor> partition_fd_;
 
   // Buffer for storing data we read.
   brillo::Blob buffer_;