payload_generator: Mark all zero blocks in the old partition as visited.

When processing duplicated and zeroed blocks, discard all the zeroed
blocks from the source partition since it doesn't make sense to waste
I/O reading them, and all the new zeroed blocks are taken care of in a
different way.

This also solves the problem that those zeroed blocks might actually not
be written in the source slot when flashing an image with fastboot.

Bug: 28626303
TEST=deployed an update on a device after flashing it with fastboot.

(cherry picked from commit a57ce77c1e7c0e7c1caa825e3f8ca204c3e5900a)

Change-Id: Ie284be0d8f699f93aae796642d9dff5e10519ce2
diff --git a/payload_generator/delta_diff_utils.cc b/payload_generator/delta_diff_utils.cc
index 0782a8c..d4070cc 100644
--- a/payload_generator/delta_diff_utils.cc
+++ b/payload_generator/delta_diff_utils.cc
@@ -320,6 +320,13 @@
   for (uint64_t block = old_num_blocks; block-- > 0; ) {
     if (old_block_ids[block] != 0 && !old_visited_blocks->ContainsBlock(block))
       old_blocks_map[old_block_ids[block]].push_back(block);
+
+    // Mark all zeroed blocks in the old image as "used" since it doesn't make
+    // any sense to spend I/O to read zeros from the source partition and more
+    // importantly, these could sometimes be blocks discarded in the SSD which
+    // would read non-zero values.
+    if (old_block_ids[block] == 0)
+      old_visited_blocks->AddBlock(block);
   }
 
   // The collection of blocks in the new partition with just zeros. This is a