Fix race issue in EventBase::runInEventBaseThreadAndWait (t6779663)