Unbreak Special:WhatLinksHere for $wgUseLinkNamespaceDBFields=false

* Usage of the namespace selector gave a query error.
  This fixes b8c038f6784ef08205f7cf6d7cc11462140e3fa2.
* Also handle a high amount of outdated *_namespace fields better.

Change-Id: I57e51f18ae749ac64413a612d6070fab29dff51f