Fix crashes when OTA install fails on non-VABC partition

Test: th
Bug: 265759781

Change-Id: Iaca86602113fa4de16a23df777dec90300a088c7
diff --git a/payload_consumer/partition_writer.cc b/payload_consumer/partition_writer.cc
index 3432c89..d7d8bea 100644
--- a/payload_consumer/partition_writer.cc
+++ b/payload_consumer/partition_writer.cc
@@ -288,7 +288,9 @@
 }
 
 void PartitionWriter::CheckpointUpdateProgress(size_t next_op_index) {
-  target_fd_->Flush();
+  if (target_fd_) {
+    target_fd_->Flush();
+  }
 }
 
 std::unique_ptr<ExtentWriter> PartitionWriter::CreateBaseExtentWriter() {