qunit: Don't assume synchronous Deferred.resolve
* mw.loader.test: Most test did this correctly already by returning
a Promise to QUnit.test, or by using assert.async().
However two tests did not.
* mediawiki.jqueryMsg.test: Previously the async() handles were
obtained within the task execution loop. Before jQuery 3.0,
simple .then() operations when they are already resolved happen
synchronously, so the current handle was resolved and the next
handle obtained in the same go and QUnit never saw the state
as having no unresolved async handles.
With jQuery 3.0 the test fails because QUnit would end the test
after the first iteration.
Fix by simply obtaining all the async() handles when creating the
list of tasks, instead of within the individual task execution.
This way they're all reserved and they'll count down as we go.
* mediawiki.api.test: Consistently use 'respondImmediately' for
the tests that were missing it, and return promise to QUnit.test()
Also update hardcoded API urls that encoded space as '+', which may
now be encoded as '%20'.
Bug: T124742
Change-Id: If7ee1c6025be70fecc0a93d4ac155da4db6571ab