Handle the case where the directory vanishes and cwd no longer exists.