Safer check to avoid invalid reads when shutting down the slurmctld with
lots of jobs.
Fix minor memory leak in the backfill scheduler when shutting down.