made getenv() more threadsafe for win32
moved here from the newlib branch
syncing with local edit
Initial revision
123