We used to take files from the initial directory, which may or may not be
the same as the directory containing the main file (e.g. --main
foo/bar.tex), and link them to the directory corresponding to the
checkout of the main file.
Fix this, and always link files from the directory containing the main file.