feat(tui): output tasks with errors last (#8570)
### Description
This PR changes the logic of persisting task output so we now print
tasks in the following order:
- Tasks that finished successfully in order of finish
- Tasks that started, but did not finish in order of start
- Tasks that finished with non-zero exit code in order of finish
This is a change from previous behavior where they would be output
alphabetically
### Testing Instructions
Manual testing on a repo with a failure that runs early:
<img width="876" alt="Screenshot 2024-06-21 at 2 59 14 PM"
src="https://github.com/vercel/turbo/assets/4131117/cfa8616c-00c7-4cde-9291-906725d1a8fb">