cutil waitable: fix edge case when emit() is called before the retraction of a wait()