Graceful shutdown of web server