mash: Cleanly exit on SIGTERM, SIGINT, SIGHUP

This is needed for the Chrome OS session_manager to cleanly shutdown chrome
on device shutdown and in tests. It's also useful on Linux desktop to cleanly
exit chrome in response to control-C.

* Refactor ShutdownDetector and signal handlers out of
ChromeBrowserMainPartsPosix. Make it run a shutdown callback.
* Use shutdown callback to exit the chrome --mash root process run loop.

BUG=697146,692227,696696
TEST=stop ui closes chrome quickly, session_manager doesn't send signal 9
anymore, control-C on Linux desktop cleanly exists chrome

Review-Url: https://codereview.chromium.org/2729633002
Cr-Commit-Position: refs/heads/master@{#454163}
8 files changed