MDL-39740 grade: Fix grade_item::add_idnumber strict type checking