improve webserver shutdown and free some stuff to make the valgrind output cleaner

(0) -300 -100 -30 -10 -1 +1 tip

mercurial