MDL-43222 SCORM: Fix invalid sql
Merge branch 'master_MDL-43222' of git://github.com/danmarsden/moodle
Merge branch 'MDL-33952-master-fix2' of git://github.com/damyon/moodle
MDL-25500 lock: New locking framework.

This locking system is designed to be used everywhere requiring
locking in Moodle. Each use of the locking system can be configured
to use a different type of locking (or the same type with a different
configuration).

The first supported lock types are memcache, memcached, file (flock),
db (specific handlers for pg, mysql and mariadb).