Fix file.recurse states with trailing slashes in source

Resolves #11002.
Merge pull request #11070 from terminalmage/11002

Fix file.recurse states with trailing slashes in source