Make `check_event_allowed` module API callback not fail open (accept events) when an exception is raised (#11033)