fix(logs): create log files for non-cached tasks (#10806)
### Description
We previously were not writing task logs if the task was not cached.
This isn't desired when using the TUI as a user might want to read a
specific task's logs.
This PR starts writing task logs for non-cached tasks as well as ensure
they are written to periodically.
### Testing Instructions
Run a non-cached persistent task and verify that you can `tail -f` the
logs