(#20308) Fix dropping paths from fileset results

This fixes the issue in #20308 where some paths get dropped from the fileset
results. When a directory contained both subdirectories and files, and the
last entry was a file, it could cause the recursion to exit early. This
removes the complexity of tracking the next recursion level separately.

Paired-with: Andrew Parker <andy@puppetlabs.com>
(#20308) Refactor fileset recursion for clarity

The previous expression of the algorithm for traversing the file structure and
producing the available files was hard to understand and therefore error prone
(see the bug that is being fixed here). This refactors it to be better
separated and should be easier to see any problems in it.

Another part of the cleanup was to make checks against the filesystem more
explicit: either the path is valid or not, whether the path is a directory.

Paired-with: Andrew Parker <andy@puppetlabs.com>
(#20308) Clean up the fileset specs

Paired-with: Andrew Parker <andy@puppetlabs.com>