Call atexit hook when we want to graceful reload and there are no requests being served. Otherwise call it when the last request finishes.