Get pre-assigned agent counts in main job query

This saves us one query per job, which in this particular case is a big
deal. With sqlite and 1050 jobs, the reduces the scheduler's runtime
from > 2 minutes to < 10 seconds on my machine.