Before this change files that were in the cache and renamed with --vfs-cache-mode minimal weren't renamed at all. This fixes the problem and adds tests for all the different combinations of cache modes and in and out of the cache.