Message::setContext() called $context->getLanguage(), loading the user
options from the database, which is unnecessary if
Message::inLanguage() is called immediately afterwards.
In a ResourceLoader module, RequestContext::getLanguage() throws an
exception due to MW_NO_SESSION being defined. For example, an exception
was thrown if any HTTP client error was encountered, since log message
formatting includes a call to Message::setContext().
So defer the call to RequestContext::getLanguage() by having
Message::setContext() make a closure which later fetches the language if
necessary.
Add an integration test which previously failed.
Change-Id: I326c7e3a9492952d721fb52f1868ab9c1033e683