PLA-528 -- only register a wiki match if wiki is not closed and language matches current language

Inter-wiki matching didn't provide error-handling for cases where a wiki is closed. This meant that providing a string match for a wiki that was in the city_list table and closed would result in a fatal error. We address this by accessing the table row for that particular wiki ID and checking if it is closed, and then using the language data from that row rather than wgLanguageCode (which we have found to be inconsistent and often empty) to cross-check that the wiki should appear in the provided PTT use cases.

Because of that, this also provides a long-term fix for PLA-523, so I'm suggesting that we merge the PLA-528 changes to release branches to address the P2 issue, but ultimately only merge this to dev, since it also includes the necessary changes to make PTT work with higher coverage for edge cases.