Fixing sort ordering when getting new jobs from JobManager

This fixes the bug where any job can be returned in any order, when the priorities are the same. This adds a second sort order of the when column after priority.