Fix possible nullpointerexception when shutting down server while web
page is loading.