Make application process wait for its children on TERM

We already do this when the watcher becomes stale.

Cleaned up some of the code in the process.
Only call on_stale listeners once
Don't allow state transitions when exiting

For example if we do terminating -> exiting, then get another SIGTERM,
we don't want to go back to the terminating state.
improve log output
Handle recursively executing spring commands better

A spring command should be able to change the Gemfile and then call back
into spring, with the Gemfile changes reflected.

See https://github.com/rails/rails/issues/13381
Make application restarts self-healing

If you introduce an initialization error, spring will watch all the
files that were loaded up to that point, and will try to start the
application again if anything changes.