Handle _io_unflatten_object when _thread_local.output_dir is not available
[🤖]: Hi @hemildesai 👋,

We wanted to let you know that a [CICD pipeline](https://github.com/NVIDIA/NeMo/actions/runs/11829062513) for this PR just finished successfully

So it might be time to merge this PR or get some approvals

I'm just a bot so I'll leave it you what to do next.

//cc @pablo-garay @ko3n1g
This prevents errors of the form
```
penwebtext/0 [default0]:  File "/opt/NeMo/nemo/lightning/io/mixin.py", line 564, in _io_unflatten_object
penwebtext/0 [default0]:    assert hasattr(_thread_local, "output_dir")
penwebtext/0 [default0]:AssertionError
```