Fix file discovery if the profile contains "use:"

The hook filename (if any) is moved into the PackageYAML class which
already encapsulates filesystem information.