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

- the environPtr initializer was only called for the main thread
Merge pull request #1696 from dawgfoto/fix11112

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