Bug 1027232 - Restart b2g at each app. Wait for the homescreen to be ready

This actually seems like it belongs in https://github.com/mozilla-b2g/marionette-device-host rather than this shell script