Fix issues with $_ENV on Windows

This fixes issues with 2.0.8 on Windows (being discussed on 167135b).

I've tested this on Windows 8.1 (6.3.9600) and the Windows 10 technical preview (6.4.9879). I don't have any older versions of Windows handy, but it should work on those as well.