Fix periodic events in libevent backend.