AU: Pass opened device fd from update engine to bspatch.

Whenever a device is written and closes, some processing happens
(involving udev, devicekit-disks, udev, and even
chrome). Historically, bspatch called open, write, close on the raw
device, thus causing much CPU usage every time bspatch was called,
which can be many times per second for delta updates.

This CL causes us to pass /dev/fd/## and the file descriptor to
bspatch. A corresponding CL causes bspatch to detect this and skip
open/close calls. Together, these CLs dramatically reduce resource
usage on clients performing delta updates.

BUG=7636
TEST=unittests; tested delta update on device

Review URL: http://codereview.chromium.org/3723005
diff --git a/subprocess.cc b/subprocess.cc
index 28b895c..49fc4c3 100755
--- a/subprocess.cc
+++ b/subprocess.cc
@@ -135,8 +135,9 @@
   }
 }
 
-bool Subprocess::SynchronousExec(const std::vector<std::string>& cmd,
-                                 int* return_code) {
+bool Subprocess::SynchronousExecFlags(const std::vector<std::string>& cmd,
+                                      int* return_code,
+                                      GSpawnFlags flags) {
   GError* err = NULL;
   scoped_array<char*> argv(new char*[cmd.size() + 1]);
   for (unsigned int i = 0; i < cmd.size(); i++) {
@@ -157,16 +158,17 @@
 
   char* child_stdout;
 
-  bool success = g_spawn_sync(NULL,  // working directory
-                              argv.get(),
-                              argp,
-                              G_SPAWN_STDERR_TO_DEV_NULL,  // flags
-                              GRedirectStderrToStdout,  // child setup function
-                              NULL,  // data for child setup function
-                              &child_stdout,
-                              NULL,
-                              return_code,
-                              &err);
+  bool success = g_spawn_sync(
+      NULL,  // working directory
+      argv.get(),
+      argp,
+      static_cast<GSpawnFlags>(G_SPAWN_STDERR_TO_DEV_NULL | flags),  // flags
+      GRedirectStderrToStdout,  // child setup function
+      NULL,  // data for child setup function
+      &child_stdout,
+      NULL,
+      return_code,
+      &err);
   FreeArgv(argv.get());
   if (err)
     LOG(INFO) << "err is: " << err->code << ", " << err->message;