check return value of syscall.Chdir when changing working directory
Merge pull request #2198 from hamo/hamo/chdir_error

check return value of syscall.Chdir when changing working directory