Fix module resolver infinite loop for Windows

The loop `while dir not in invalidDirs and dir not in modulePaths` could become an infinite loop on Windows because "C:\\" is not in the list of invalid directories.

Could also do this another way, but this fix should handle 99.9% of the cases (there could also be a network share like "\\share\some\path" but most developers don't use that directly).