Improve webserver shutdown