MDL-47735 core: prevented iteration of 'groupmembersonly'

The course module variable 'groupmembersonly' was removed in 2.8.