packagefs: Refactor UnpackingAttributeDirectoryCookie Pull out a reusable base class AutoPackageAttributeDirectoryCookie.