getcwd: don't fail in a deep directory on a system without openat