this prevents a race condition where an event is sent as a port is being destroyed. when the server gets around to handling the event, it now refers to a different port that was created in the mean-time.