Improve cleanup for websockets unload tests