AU: Delta Diff Generator

Adds a class that can take two root filesystem image and generate a
delta between them. Currently it's not very well tested, but this will
improve once the diff applicator is written.

Also, an executable to run the generator.

Other changes:
- Stop leaking loop devices in unittests
- extent mapper: support sparse files, ability to get FS block size
- AppendBlockToExtents support sparse files
- subprocess more verbose on errors
- add WriteAll to utils (WriteAll avoids short-write() returns)
- mkstemp wrapper for ease of use
- VectorIndexOf, finds index of an element in a vector

Review URL: http://codereview.chromium.org/891002
diff --git a/filesystem_copier_action_unittest.cc b/filesystem_copier_action_unittest.cc
index 1e024f1..86c15ac 100644
--- a/filesystem_copier_action_unittest.cc
+++ b/filesystem_copier_action_unittest.cc
@@ -137,8 +137,8 @@
   g_main_loop_unref(loop);
 
   EXPECT_EQ(0, System(string("losetup -d ") + dev));
-  EXPECT_EQ(0, System(string("umount ") + TestDir() + "/mnt/some_dir/mnt"));
-  EXPECT_EQ(0, System(string("umount ") + TestDir() + "/mnt"));
+  EXPECT_EQ(0, System(string("umount -d ") + TestDir() + "/mnt/some_dir/mnt"));
+  EXPECT_EQ(0, System(string("umount -d ") + TestDir() + "/mnt"));
   EXPECT_EQ(0, unlink(a_image.c_str()));
   EXPECT_EQ(0, unlink(b_image.c_str()));
 
@@ -168,7 +168,7 @@
   EXPECT_TRUE(utils::ReadFileToString(TestDir() + "/mnt/hello", &file_data));
   EXPECT_EQ("hello\n", file_data);
   EXPECT_EQ("/some/target", Readlink(TestDir() + "/mnt/sym"));
-  EXPECT_EQ(0, System(string("umount ") + TestDir() + "/mnt"));
+  EXPECT_EQ(0, System(string("umount -d ") + TestDir() + "/mnt"));
 
   EXPECT_EQ(0, unlink(out_image.c_str()));
   EXPECT_EQ(0, rmdir((TestDir() + "/mnt").c_str()));