mediawiki.api: Use then() in getToken instead of manual Deferred wrapping

* Use then() instead of done()/fail() with a manually created
  Deferred as wrapper. This also makes the passing on of the
  error more explicit.

* Store promises with an abort handler instead of Deferreds, so
  that we don't need to call "d.promise( { abort: d.abort } )"
  again on each return to re-attach the abort, simply do it right
  the first time. We don't need to store the Deferred's handlers
  since only the closure of the caller needs access to
  resolve/reject it. The cached one only needs to be a promise.

* Rename relevant variables to avoid further confusion.

Change-Id: If8995ede271746580c3f2eb0b4a6ecd79e90c7d5
Merge "mediawiki.api: Use then() in getToken instead of manual Deferred wrapping"