Set the block device to be writable before writing verity data

The block device is set to be writable when the delta performer opens
the partition to perfrom writes. But if the update interrupts and the
device reboots during the verity data calculation, update engine will
consider the write actions done on resumes and skip setting the writable
flag. As a result, the resumed update will fail to write the hashtree
with EPERM.

A possible fix is to explicltly set the flag when the FilesystemVerifierAction
wants to write verity data.

Bug: 131232680
Test: Interrupt the update during verity writing, reboot and check the
update resumes correctly

Change-Id: I1007414139e4ae5be3fc60ec73b18264d4baa60e
diff --git a/payload_consumer/verity_writer_android.cc b/payload_consumer/verity_writer_android.cc
index 06d1489..d5437b6 100644
--- a/payload_consumer/verity_writer_android.cc
+++ b/payload_consumer/verity_writer_android.cc
@@ -41,6 +41,9 @@
 bool VerityWriterAndroid::Init(const InstallPlan::Partition& partition) {
   partition_ = &partition;
 
+  if (partition_->hash_tree_size != 0 || partition_->fec_size != 0) {
+    utils::SetBlockDeviceReadOnly(partition_->target_path, false);
+  }
   if (partition_->hash_tree_size != 0) {
     auto hash_function =
         HashTreeBuilder::HashFunction(partition_->hash_tree_algorithm);