Account for locked_at in job_count query

This prevents relative_count being greater than the number of runnable jobs in the job selection query