fix Issue 11112 - Unable to execute shell commands in different threads

- the environPtr initializer was only called for the main thread

[Issue 11112](https://d.puremagic.com/issues/show_bug.cgi?id=11112 "Unable to execute shell commands in different threads")