unix: avoid use-after-free in ep_remove_wait_queue