Fix a race that occurred when notifying a thread that was blocked on a
promise to wake up, but that thread simultaneously awoke for another
reason (probably a timeout)