Issue #2896480 by mpdonadio, dawehner, Berdir, martin107: Allow to reference permanent files with 0 usages (cherry picked from commit fdef8555)