Fix issue where ecs system::set_event_handler doesn't lock