Sort task list by priority