Make path checking more robust on windows.

Eliminates some useless warnings on Windows about PYTHONPATH.