MDL-45145 mod_quiz: ensure quiz cmid is set before triggering the 'attempt_deleted' event