Handle errors on partition close

We flush in memory data to disk when PartitionWriter::Close() is called,
currently errors reported in this method are ignored by DeltaPerformer.
Fix by propagating the errors upwards and report an OTA failure.

Test: th
Bug: 315973255
Change-Id: I9c55cf291c0e14868be79a36f7e89b27ed9662dc
diff --git a/payload_consumer/delta_performer.cc b/payload_consumer/delta_performer.cc
index dcbf2cc..fe32201 100644
--- a/payload_consumer/delta_performer.cc
+++ b/payload_consumer/delta_performer.cc
@@ -530,7 +530,10 @@
       manifest_.mutable_dynamic_partition_metadata()
           ->mutable_vabc_feature_set()
           ->set_threaded(install_plan_->enable_threading.value());
-      LOG(INFO) << "Attempting to enable multi-threaded compression for VABC";
+      LOG(INFO) << "Attempting to "
+                << (install_plan_->enable_threading.value() ? "enable"
+                                                            : "disable")
+                << " multi-threaded compression for VABC";
     }
     if (install_plan_->batched_writes) {
       manifest_.mutable_dynamic_partition_metadata()
@@ -598,7 +601,13 @@
           return false;
         }
       }
-      CloseCurrentPartition();
+      const auto err = CloseCurrentPartition();
+      if (err < 0) {
+        LOG(ERROR) << "Failed to close partition "
+                   << partitions_[current_partition_].partition_name() << " "
+                   << strerror(-err);
+        return false;
+      }
       // Skip until there are operations for current_partition_.
       while (next_operation_num_ >= acc_num_operations_[current_partition_]) {
         current_partition_++;