MDL-39552 Make behat code re-entrant safe

With yui combo in action, some times setup.php is
included more than once. So it's mandatory to
guarantee that code until ABORT_AFTER_CONFIG_CANCEL
can be executed safely multiple times in the same
request.

This change just prevents the behat section to be executed
more than once. All the values that are set within it
should be already defined for the re-entrant call.
Merge branch 'MDL-34275-master' of git://github.com/danpoltawski/moodle
MDL-32301: Allow instructor custom parameters for LTI tools
Merge branch 'wip-MDL-39525-m25' of git://github.com/samhemelryk/moodle
Merge branch 'wip-MDL-39538-master' of git://github.com/marinaglancy/moodle
MDL-39538 take rid of unused global
Merge branch 'MDL-32301_lti_instructor_params' of https://github.com/moodlerooms/moodle
Merge branch 'MDL-39452-master' of git://github.com/sammarshallou/moodle
Merge branch 'MDL-39481_master' of git://github.com/dmonllao/moodle
Merge branch 'wip-mdl-39332' of git://github.com/rajeshtaneja/moodle
MDL-37475 core_grade:fixed the handling of show totals
MDL-39554 cache: forced sharing options for static + request
MDL-39554 cache: sharing link only shown in multiple options are available
Merge branch 'wip-MDL-39554-m25' of git://github.com/samhemelryk/moodle
MDL-39462 added missing clearing of coursecat cache
MDL-39542 course: Return to right section when JS is off
MDL-39397 badges: Handle course badges when course is deleted
Merge branch 'MDL-37552-master' of git://github.com/mouneyrac/moodle
Merge branch 'MDL-29472_m' of git://github.com/andreabix/moodle
MDL-29472: Cohorts webservice - fix numerous access problems and add to the unit tests.

Also allow 'system' as a category type to allow you to create/update system wide cohorts.