Issue #1313368 by pfrenssen: remove $GLOBALS['lock'] usage in ctools_flush_caches()