### Summary

If you run `ANSIBLE_LOG_PATH=test ansible localhost -m setup`, `test` is now an empty file. Before #81692 got merged, it contained log output like
```
023-11-16 08:01:52,262 p=313108 u=felix n=ansible | [WARNING]: You are running the development version of Ansible. You should only run Ansible from "devel" if you are modifying the Ansible engine, or trying out features under development.
This is a rapidly changing source of code and can become unstable at any point.

2023-11-16 08:01:52,383 p=313108 u=felix n=ansible | [WARNING]: No inventory was parsed, only implicit localhost is available

2023-11-16 08:01:53,511 p=313108 u=felix n=ansible | localhost | SUCCESS => {
    "ansible_facts": {
...
```

### Issue Type

Bug Report

### Component Name

logging

### Ansible Version

```console
latest devel branch
```


### Configuration

```console
-
```


### OS / Environment

-

### Steps to Reproduce

Run `ANSIBLE_LOG_PATH=test ansible localhost -m setup`

### Expected Results

File `test` contains log output.

### Actual Results

```console
File `test` is empty.
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
if os.isatty(1):
            tty_size = unpack('HHHH', fcntl.ioctl(1, termios.TIOCGWINSZ, pack('HHHH', 0, 0, 0, 0)))[1]
        else:
            tty_size = 0
        self.columns = max(79, tty_size - 1)
    def prompt_until(
        self,
        msg: str,
        private: bool = False,
        seconds: int | None = None,
        interrupt_input: c.Container[bytes] | None = None,
        complete_input: c.Container[bytes] | None = None,
    ) -> bytes:
        if self._final_q:
            from ansible.executor.process.worker import current_worker
            self._final_q.send_prompt(
                worker_id=current_worker.worker_id, prompt=msg, private=private, seconds=seconds,
                interrupt_input=interrupt_input, complete_input=complete_input
            )
            return current_worker.worker_queue.get()
        if HAS_CURSES and not self.setup_curses:
            setupterm()
            self.setup_curses = True
        if (
            self._stdin_fd is None
            or not os.isatty(self._stdin_fd)