Simplies logic to just use nearest parent as the base instead of
traversing downwards. This reduces some redundancy, however fixes a bug
with repeated components in the constructed path and also improves
performance by skipping a loop altogether.
Also fixes recursive extraction tests failing `pandoc_soft_links.zip`.