MDL-54582 accesslib: improve performance of load_course_context
MDL-54582 accesslib: improve performance of load_course_context

The new query is logically equivalen, but much, much faster, at
least on Postgred. (15ms, instead of 700ms, in one example I tried
on the database for the OU's main Moodle site.)

dilawar/moodle