Fix race condition adding links.