[`logging.py`] set default `stderr`  path if `None`
# What does this PR do?
Attempt to fix #24047

Thanks to contributors, seems like the issue [is known](https://github.com/pyinstaller/pyinstaller/issues/7334#issuecomment-1357447176). 
Though it is not entirely related to `transformers`, adding a safeguard seems like a good practice
_The documentation is not available anymore as the PR was closed or merged._<|||||>Monkey patching globals like `sys.stdout` and `sys.stderr` is more of an emergency hack than a fix that libraries should be using. The proper way to handle Python windowed mode is to guard any direct usage of `sys.stderr` in `if sys.stderr is not None` blocks.

```python
sys.stderr.write("hello")  # This is broken

# Any of these are fine
if sys.stderr:
    sys.stderr.write("hello")
print("hello", file=sys.stderr)
```

>  Though it is not entirely related to transformers, adding a safeguard seems like a good practice

It is related to any library that uses `sys.stderr` directly. 