feat(ui): persist logs on failure (#7805)
### Description
If a task fails when using the UI, it isn't easy to find the reason for
the failure.
This PR makes it so that if a task fails, we'll persist the logs to the
terminal so they remain after the UI exits.
### Testing Instructions
<img width="1034" alt="Screenshot 2024-03-21 at 9 46 11 AM"
src="https://github.com/vercel/turbo/assets/4131117/31a6f29d-22c2-4ad9-a569-a95afb200f54">
Closes TURBO-2681