deploy_chrome: convert umount logic away from shell=True

This code path requires an array all the time, so just convert it away
from using shell=True.

BUG=chromium:773831
TEST=deploy_chrome w/--mount-dir passes

Change-Id: Ia7cccdb83e7eb9e3e63fd773734e308c876dab2e
Reviewed-on: https://chromium-review.googlesource.com/714024
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Dan Erat <derat@chromium.org>
diff --git a/scripts/deploy_chrome.py b/scripts/deploy_chrome.py
index 9219879..ef112c7 100644
--- a/scripts/deploy_chrome.py
+++ b/scripts/deploy_chrome.py
@@ -318,8 +318,10 @@
     self.device.RunCommand(['mkdir', '-p', '--mode', '0775',
                             self.options.mount_dir])
     # Umount the existing mount on mount_dir if present first
-    cmd = 'if mountpoint -q %(dir)s; then umount %(dir)s; fi'
-    self.device.RunCommand(cmd % {'dir': self.options.mount_dir}, shell=True)
+    ret = self.device.RunCommand(['mountpoint', '-q', self.options.mount_dir],
+                                 error_code_ok=True)
+    if ret.returncode == 0:
+      self.device.RunCommand(['umount', self.options.mount_dir])
     self.device.RunCommand(['mount', '--rbind', self.options.target_dir,
                             self.options.mount_dir])
     # Chrome needs partition to have exec and suid flags set