Overhaul to handle SIGTERM properly.

I found that our attempted top-level trap was preventing the app from receiving SIGTERM for orderly shutdown of the dyno. After some experimentation, here's what I came up with. See https://gist.github.com/agriffis/9798319 for my test script. (You can run it on the command-line with values for $1 and $2 to see how the overall manager behaves when processes die by various causes.)

I'm using this now on deployed servers.