AU: Execute postinst asynchronously so that the D-Bus service is not blocked.

This CL also cleans up Subprocess memory handling a bit and extends it to
capture the output of asynchronous subprocesses. Also adds a scoped temp mount
unmounter utility class.

BUG=8937
TEST=unit tests, tested on the device -- making sure no D-Bus calls timeou
during postinstall.

Change-Id: I219dda3dc98d875ff05050f1a32ffcc925db1d53

Review URL: http://codereview.chromium.org/4690006
diff --git a/postinstall_runner_action.h b/postinstall_runner_action.h
index c2498e0..9a2ebcb 100644
--- a/postinstall_runner_action.h
+++ b/postinstall_runner_action.h
@@ -6,6 +6,7 @@
 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_POSTINSTALL_RUNNER_ACTION_H__
 
 #include <string>
+
 #include "update_engine/action.h"
 #include "update_engine/install_plan.h"
 
@@ -35,8 +36,7 @@
       OutputObjectType;
   void PerformAction();
 
-  // This is a synchronous action, and thus TerminateProcessing() should
-  // never be called
+  // Note that there's no support for terminating this action currently.
   void TerminateProcessing() { CHECK(false); }
 
   // Debugging/logging
@@ -44,6 +44,14 @@
   std::string Type() const { return StaticType(); }
 
  private:
+  // Subprocess::Exec callback.
+  void CompletePostinstall(int return_code);
+  static void StaticCompletePostinstall(int return_code,
+                                        const std::string& output,
+                                        void* p);
+
+  std::string temp_rootfs_dir_;
+
   DISALLOW_COPY_AND_ASSIGN(PostinstallRunnerAction);
 };