toolchain-utils: add RunCommandWExceptionCleanup to command_executer

RunCommandWExceptionCleanup will kill the spawned child process if a exception
is thrown. This mainly handles the case of a KeyboardInterrupt being raised
but the child process will continue to run. Added except_handler to
RunCommandGeneric and RunCommand2 to support this functionality.

TEST=Run cros flash usb:// and Ctrl-c properly kills cros flash
BUG=chromium:618461

Change-Id: I8195afcc310ab36b2631bb1ecc43a6fb8befec46
Reviewed-on: https://chrome-internal-review.googlesource.com/263665
Commit-Ready: Cassidy Burden <cburden@google.com>
Tested-by: Cassidy Burden <cburden@google.com>
Reviewed-by: Caroline Tice <cmtice@google.com>
1 file changed