Clean shutdown

Add resiliency against possible hanging on shutdown. The only change that's needed to resolve the cases we've seen is the addition of `exit 0` to the `cli.rb`. The other modifications are preemptive fixes to other paths that could lead to a hanging shutdown.

RFC @liveh2o @abrandoned @localshred