MDL-44366 improve glossary filter performance

This should have when there are no glossaries in course or
when there are no linked entries in existing glossaries.