(Bug 47482) Update redis in bulk onTransactionIdle

Change I00107ffc9 in mediawiki/core makes WikiPage::updateCategoryCounts defer
work to a callback function which executes at the end of the current
transaction, if one is open. This means that LinksUpdateComplete is no longer
guaranteed to run after CategoryAfterPageAdded / CategoryAfterPageRemoved.
Consequently we can no longer rely on it for batch-processing all pending
updates.

This change uses a different mechanism to defer batch processing of redis
updates to a Database->onTransactionIdle callback.

Change-Id: Ib073661c267cbabbe2ab2245224afd12b8784fca