pool: Fix race conditions and counting errors in mover scheduler

SimpleIoScheduler had several bugs:

- The scheduler loop took an element out of the queue before acquiring
  a transfer slot. This means that when all transfer slots are taken, the
  scheduler loop blocks for a slot to become available and at the same
  time the mover was already removed from the queue.

  Thus the mover is no longer counted as queued and also not counted
  as running, meaning we "lost" one mover in the mover stats.

  It also means that if an attempt is made to cancel this mover, the mover
  is considered to be running and thus the mover is killed rather than
  just removed from the queue. However since the mover is not actually
  running, the kill will not have an effect until a transfer slot becomes
  available - at which point the mover is killed right away.

- Post processing happened after the transfer slot was released. This meant
  that registration in the name space and on-write checksum computation
  would not be subject to the regular queue restrictions. They would not
  count towards the mover stats and there was in fact no limit as to how
  many concurrent on-write checksum computations could run.

This patch solves both problems.

Target: trunk
Request: 2.5
Request: 2.2
Request: 1.9.12
Require-notes: yes
Require-book: no
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: http://rb.dcache.org/r/5288/