packed_peel_ref(): new function, extracted from `files_peel_ref()`