Check for ENV['CD'] instead of ENV['PWD'] on windows.

Also the associated test is removed as I am not sure how it should be fixed.