MDL-47208 core_availability: Return false when cm isnt in modinfo list

If a cm isn't in modinfo's cm list, then the user shouldn't be able to see that cm.
This fixes an issue where hidden activities would cause users to be unable to use moodle.