test: fix chdir. on darwin tmpdir points to a symlinked dir. use getwd to be sure