Fix some race conditions in persistent events and event_reinit I found these by adding an EVENT_BASE_ASSERT_LOCKED() call to most of the functions in event.c that can only be called while holding the lock. event_reinit() never grabbed the lock, but it needed to. event_persist_closure accessed the base to call event_add_internal() and gettime() when its caller had already dropped the lock. event_pending() called gettime() without grabbing the lock.