MDL-51371 course: fix core_course_get_course_module assertion