mediawiki.api: Simplify done/fail calls by chaining

Change-Id: Ic0c1928708612d31abcd6c5c7184f68b2e7c1a76
Merge "mediawiki.api: Simplify done/fail calls by chaining"