(bug 45997) Send changes to most stale wiki first.

Previously, we picked a target wiki for dispatching at random.
This lead to a median dispatch lag of more than one hour of
the Wikimedia cluster.

This change introduces a new logic:

  Pick a random target from a small set of candidate targets.
  That set consists of the n targets with the lowest processed
  change ID that satisfy the following conditions:

  have not been touched for $dispatchInterval seconds
     ( or are lagging by more changes than given by batchSize )
  and are not locked
      ( or the lock is older than $lockGraceInterval ).
  and have not seen all changes
  and are not disabled

Please test this with multiple instances of the dispatchChanges
script running in parallel, dispatching to multiple target wikis.

Bugs: 45997, 46259.

Change-Id: Ibae269e72a9e77b9165c29c1c9214fa03ff0f02b