Implement setenv correctly and support setting values to empty strings
Summary: Just calling `SetEnvironmentVariableA` wasn't updating `_environ`, which meant that calls to `getenv` weren't reflecting the changes made via `setenv`. The correct way to implement it is using `_putenv_s`, but there's one problem with that: passing an empty string as the value to `_putenv_s` results in the environment variable being unset. To make it possible to set the environment variable to an empty string, we shall dive head-first into the implementation details of the CRT and emerge victorious by blatently ignoring the documentation of `getenv` and modifying the string it returns to terminate it early.
Reviewed By: yfeldblum
Differential Revision:
D3691007
fbshipit-source-id:
350c2ec72ec90b9178a9a45b2c2ed2659b788e37