Implement restart/shutdown support

The Marionette server will listen for shutdowns (that includes restarts) and
will prepare the Marionette client appropriately. Whenever the server detects
a shutdown (or a kill is requested) the client receives a message and then
waits until the process has gone away and restarts it.
Bug 923606 - Add Marionette tests to cover startup/shutdown paths