Fix a race in rescheduling jobs
Fix a race in rescheduling jobs

When handling the queue, in particular at analyzing job dependencies,
we assume that all non-finalized jobs are present in the Queue data
structure. When rescheduling jobs we move them from the running part
of the queue to the scheduled part again. In order to comply with the
just mentioned in variant, we need to do so in a single atomic
modification instead of sequentially modifying the data structure.

Signed-off-by: Klaus Aehlig <4ce51de36d9068cd7db2eec1151e0f3f95419008@google.com>
Reviewed-by: Petr Pudlak <9d19625f8ee825a2c398462ed335cbcf98f79c32@google.com>

onponomarev/ganeti,leshchevds/ganeti,ganeti-github-testing/ganeti-test-1,andir/ganeti,bitemyapp/ganeti,ganeti-github-testing/ganeti-test-1,dimara/ganeti,andir/ganeti,mbakke/ganeti,grnet/snf-ganeti,andir/ganeti,onponomarev/ganeti,dimara/ganeti,ganeti/ganeti,apyrgio/ganeti,mbakke/ganeti,bitemyapp/ganeti,yiannist/ganeti,ganeti/ganeti,leshchevds/ganeti,mbakke/ganeti,grnet/snf-ganeti,ganeti/ganeti,yiannist/ganeti,leshchevds/ganeti,apyrgio/ganeti,yiannist/ganeti