fix: correct temporary output move when using YAML `SafeDumper`
When a `CSafeDumper` is not available, we fallback to `SafeDumper`. This correctly invokes the `__del__` function in the order that the garbage collector runs. It results in the following error: ``` Exception ignored in: <function Closer.__del__ at 0x7f9547c3b420> Traceback (most recent call last): File ".../pre-commit/config/cli.runfiles/_main/pre-commit/config/cli.py", line 175, in __del__ self.close() File ".../pre-commit/config/cli.runfiles/_main/pre-commit/config/cli.py", line 170, in close self.__file.flush() File ".../python3.13/tempfile.py", line 499, in func_wrapper return func(*args, **kwargs) ValueError: I/O operation on closed file. ``` This occurs because the `NamedTemporaryFile.__del__` runs before the `Closer.__del__`. The `NamedTemporaryFile.__del__` closes then, then deletes the file. Setting `delete=False` will not help. We move the `NamedTemporaryFile` into the `Closer` (renamed to `TemporaryRedirectFile`) to correct the closing order.
Loading