Fix -Wunused-result warning for chdir on linux.