CoreCLR, the runtime of dotnet, has some issues regarding storing
environment variables (see dotnet/coreclr issue #15812), keeping them in
a local cache instead of flushing to the native setenv.
This commit replaces the usage of
System.Environment.SetEnvironmentVariable with a setenv wrapper.