Special pages for login and signup contain language selector links
to change the interface language, the available languages are defined
via the `loginlanguagelinks` message. Invalid codes will make the
pages completely inaccessible, preventing account creation and login.
This patch improves the link generation logic to only create links
for codes considered valid by LanguageNameUtils.
Bug: T384995
Change-Id: I4f470dc417a773225ba335f95da1151525a2f620
(cherry picked from commit da179c65056d65dc5d610af1e29fed57df4f1082)