MDL-41114 Avoid unnecessary retrieving of coursecat from DB

- course category depth can be estimated in make_categories_options() by the number of separators