Make unit tests less timing sensitive when unmounting busy loop devices.

This CL modifies utils::UnmountFilesystem() to retry when umount()
fails to unmount a busy loop device and replaces several unit tests to
use the modified utils::UnmountFilesystem() instead of calling
System("umount").

BUG=chromium-os:35112
TEST=Run unit tests repeatedly.

Change-Id: I42978f02b4797c68acbec6c351ea2663b9ec7b59
Reviewed-on: https://gerrit.chromium.org/gerrit/34862
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>
diff --git a/filesystem_iterator_unittest.cc b/filesystem_iterator_unittest.cc
index aca95ff..aed16e5 100644
--- a/filesystem_iterator_unittest.cc
+++ b/filesystem_iterator_unittest.cc
@@ -57,9 +57,9 @@
   set<string> expected_paths(expected_paths_vector.begin(),
                              expected_paths_vector.end());
   VerifyAllPaths(kMountPath, expected_paths);
-  
-  EXPECT_EQ(0, System(string("umount ") + kMountPath + "/some_dir/mnt"));
-  EXPECT_EQ(0, System(string("umount ") + kMountPath));
+
+  EXPECT_TRUE(utils::UnmountFilesystem(kMountPath + string("/some_dir/mnt")));
+  EXPECT_TRUE(utils::UnmountFilesystem(kMountPath));
   EXPECT_EQ(0, System(string("rm -f ") + first_image + " " + sub_image));
 }