Fix a locking bug in event_base_loop() We previously were releasing the lock when we exited the main loop in some ways, but not in others.