Cache: better rename hook for cache updater

@MTGap @karlitschek @DeepDiver1975 

Should fix #2170