chdir can get ENOTDIR.