Creating a symlink will error if the file already exists, so we check
for a symlink with a different target and mark it for removal before
creation. This has a small race condition, and there may be a case
where the old symlink gets deleted but the new one does not get created.