perf(batch): reduce memory usage during batch processes

Result sets for batch queries tend to be large and bloat the query
cache without being of much use. Since the LRU cache is limited in
key size (not memory size), the simplest solution is to flush it
during batch operations.
Merge pull request #6424 from mrclay/reduce_batch_mem_usage

perf(batch): reduce memory usage during batch processes