Ensure that inlined anchor definitions take priority.

If an author defines a link inline, it's a safe bet that she wishes to
use that link in the document. This patch drops any existing references
which have the same shortname/text combination as the newly defined
anchor, and ensures that the inlined anchor is inserted at the beginning
of the list of references for a term (so that it will be the default
choice in the absence of `Link Defaults` metadata.