Use _NSGetEnviron on OS X: fixes #2458