Make network thread stop/join consistent by using a userdata __gc instead of atexit