Enforce ORDER BY and LIMIT clauses in `term_exists()` queries.

In case of edge cases where a duplicate term might exist in a replicated
database for a split second, these explicit query clauses ensure that
`term_exists()` will always recognize the oldest matched term as the
canonical one. See [30238] for background.

Props pento.
See #22023, #5809.

git-svn-id: https://develop.svn.wordpress.org/trunk@30239 602fd350-edb4-49c9-b593-d223f7449a82