Fixes thread-safety tests using Event.