Set working directory in SpawnPreparer because bashrc can change it. Fixes issue #851