need to import $CFG into the local function scope

fixup comments regarding hashing of keys - it does not help at all with
stale data
Merge branch 'patches/no-flock-file-cache' into MOODLE_26_STABLE-local