Implement event_finalize() and related functions to avoid certain deadlocks