MDL-68680 core_grades: check grade item before trigger delete event