Replaces broken sorting logic in queue_updates with similar code to queue_apps.

(queue_apps only does waiting time desc - other sorts are broken)