Check the global cache-enabled flag only once per query. Short-term fix to MONDRIAN-1471, "Extreme contention between queries". Based on pull request #56 from sarahgerweck/FasterCacheCheck.