Call atexit hook when we want to graceful reload and there are no requests being served. Otherwise call it when the last request finishes.
Merge pull request #262 from edevil/master

Call atexit hook after all requests are done, or immediately if there are no requests