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

This avoids pointless warnings about invalid modules.