LinksUpdate: Use DB key for category links table
The first parameter returned from findVariantLink() is not the DB key,
which whitespaces should be replaced with underscores.
Also:
- Replaced Title::makeTitleSafe with Title::makeTitle, invalid links would be treated as plain text by the parser and can never hit this code path. And the makeTitle function below is also using Title::makeTitle.
- Updated the document of findVariantLink().
Reason for backport: The bug was introduced by refactor (commit d3b2b80)
and I found this is annoying in production.
Bug: T328477
Change-Id: I2b08edd90666e0fa4eafe91444a58806909b02d6
(cherry picked from commit 1132c3dc19bfa0604c5605340c1dd11587d05789)