daemon: Change chdir to use openat/fdopendir.