mw.jqueryMsg: Handle non-string parameters to functions that expect strings better
Generally, non-string parameters should not be passed to functions
that expect strings. But sometimes we don't document the types well
and our translators do unexpected things. :)
* If the function uses the parameter to look up some other value
(e.g. {{GENDER:$1|...}}, {{PLURAL:$1|...}}), convert it to a string
by removing all formatting (using textify()) and hope for the best.
* If the function applies some textual transformation to the parameter
(e.g. {{GRAMMAR:...|$1}}, {{formatnum:$1}}), do nothing and return
the original parameter.
Bug: T203892
Change-Id: I5c760bf666cc8dae4ce10e3319366e73e2d596e8