Fix -Wunused-result warning for chdir on linux.
Merge pull request #785 from nico/unused

Fix -Wunused-result warning for chdir on linux.