util/disk_cache: do eviction before creating .tmp
util/disk_cache: do eviction before creating .tmp

cache_put() first creates a .tmp file and then tries to do eviction.
The recently added LRU eviction code selects non-empty directory with
the oldest access time, but that may easily be the one with just the
new .tmp file, especially on Linux where atime is updated lazily
(with "relatime" mount option, which is the default). So when cache is
small, if random doesn't hit another dir LRU keeps selecting the same
dir with just the .tmp and not deleting anything. To fix this (and the
tests), do eviction earlier.

Signed-off-by: Grazvydas Ignotas <eac34e836c3bc120048c86fead6dd0257a872a9e@gmail.com>
Reviewed-by: Timothy Arceri <c48760dafc316d20cf5b0817150c999e82cd892f@itsqueeze.com>

metora/MesaGLSLCompiler,metora/MesaGLSLCompiler,metora/MesaGLSLCompiler