Fixes for CEnvironment and removal of win32putenv.cpp

This is a follow up for #1272
Some fixes for CEnvironment, replacement of pgwin32_putenv, removal of win32putenv.cpp, usage of CEnvironment in several places to simplify code.