MDL-46147 modinfo: performance improvement for course page

This is a big win in a specific situation, ie filters enabled for content+headings,
and no activity descriptions visible on the course page.