evwatch: fix race condition There was a race between event_base_loop and evwatch_new (adding a prepare/check watcher while iterating over the watcher list). Only release the mutex immediately before invoking each watcher callback, and reacquire it immediately afterwards (same as is done for normal event handlers).