Fix --cache-dir not redirecting the whole cache tree (bnc#887188)