ConfigWritePath followed only one hop of a dangling link and resolved
only an existing parent directory. A project link to an in-project
link pointing outside, or to a missing file under an in-project
directory link that leaves the project, passed the containment check,
and the save then wrote or created the file outside the project.
Follow every link of a dangling chain, with a hop limit, and resolve
symlinks in the longest existing prefix of each path so a missing
directory cannot hide an escaping link above it.