(bug 45937) API: Check amlang in meta=allmessages

Language::factory() throws an exception if given a syntactically invalid
code. Check the code beforehand to generate a proper error message.

Bug: 45937
Change-Id: I521e6f7ffc44becb302fde33c1df3879baa4045a
Merge "(bug 45937) API: Check amlang in meta=allmessages"