posix: fix chdir() so it accepts a symlink, as long as the symlink targets a directory