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

- the environPtr initializer was only called for the main thread