Fixing cache tests to count queries properly

2 queries are actually issued by the single execute(), so tests were failing.  Changed it to store the count after the query is run initially, then make sure the remaining 9 executions of the query are from the cache.