prevent error on flushing empty cache
Also fix problem of section returning stale data
Merge pull request #1918 from karptonite/cache_section_patch_4.0

Safely flush empty cache section, and avoid returning stale data from sections (replaces #1906)