(PUP-3678) skip non-directories on the module path

This avoids pointless warnings about invalid modules that started with puppetlabs/puppet#3261.
Seems like the code that filters what could be a possible module name is not used consistently: https://github.com/radford/puppet/blob/4690314b547317d3fd28adbc61215abdab1d758e/lib/puppet/node/environment.rb#L393