Added graceful shutdown on SIGHUP

To be honest, I'm not sure that determining whether the request is a keepalive request is useful here, given that the only place we check for it is in check_shutdown_gracefully, and whether or not the request is a keepalive request, we'd still like to shut down gracefully.  I could be wrong, but maybe you can describe why you believe it's necessary.