Push a fix for SharedHelpers.chdir not being threadsafe

The platform detection is a bit messy and I will refactor it later