Cache: also check if the file id is already in the cache during upgrade

Should solve upgrade issues if only some of the configured storages were migrated previously.

The only way a a file id can already exists in the cache is when a previous upgrade attempt fails _after_ at least one storage has been successfully upgraded

@MTGap @karlitschek @DeepDiver1975