MDL-42302 course: fixed bugs while changing visibility

* No longer uses show which is resvered on MySQL
* Selected category courses are now always returned.