Dedupe the implementations of EventBase::runInEventBaseThreadAndWait.