make sure every pending message that wouldn't be handled because the server is closing, will be free()ed as expected.