### Summary

When calling a handler that is a task that should be run only once, the task is called twice.

### Issue Type

Bug Report

### Component Name

core

### Ansible Version

```console
$ ansible --version

ansible [core 2.14.6]
  config file = /MY_PROJECT/ansible/ansible.cfg
  configured module search path = ['/MY_PROJECT/ansible/library']
  ansible python module location = /home/naja/.local/lib/python3.10/site-packages/ansible
  ansible collection location = /home/naja/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/naja/.local/bin/ansible
  python version = 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True
```


### Configuration

```console
# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all

CONFIG_FILE() = /MY_PROJECT/ansible/ansible.cfg
DEFAULT_BECOME_METHOD(/MY_PROJECT/ansible/ansible.cfg) = sudo
DEFAULT_BECOME_USER(/MY_PROJECT/ansible/ansible.cfg) = root
DEFAULT_FILTER_PLUGIN_PATH(/MY_PROJECT/ansible/ansible.cfg) = ['/MY_PROJECT/ans>
DEFAULT_FORKS(/MY_PROJECT/ansible/ansible.cfg) = 10
DEFAULT_GATHERING(/MY_PROJECT/ansible/ansible.cfg) = explicit
DEFAULT_HASH_BEHAVIOUR(/MY_PROJECT/ansible/ansible.cfg) = merge
DEFAULT_HOST_LIST(/MY_PROJECT/ansible/ansible.cfg) = ['/MY_PROJECT/ansible/inve>
DEFAULT_JINJA2_NATIVE(/MY_PROJECT/ansible/ansible.cfg) = True
DEFAULT_LOAD_CALLBACK_PLUGINS(/MY_PROJECT/ansible/ansible.cfg) = True
DEFAULT_LOG_PATH(/MY_PROJECT/ansible/ansible.cfg) = /MY_PROJECT/ansible/logs/an>
DEFAULT_MODULE_PATH(/MY_PROJECT/ansible/ansible.cfg) = ['/MY_PROJECT/ansible/li>
DEFAULT_MODULE_UTILS_PATH(/MY_PROJECT/ansible/ansible.cfg) = ['/MY_PROJECT/ansi>
DEFAULT_ROLES_PATH(/MY_PROJECT/ansible/ansible.cfg) = ['/MY_PROJECT/ansible/rol>
DEFAULT_STDOUT_CALLBACK(/MY_PROJECT/ansible/ansible.cfg) = default.py
DEFAULT_VAULT_IDENTITY_LIST(/MY_PROJECT/ansible/ansible.cfg) = ['dts@vault/keyring-client.py', 'prod@vault/keyring-c>
HOST_KEY_CHECKING(/MY_PROJECT/ansible/ansible.cfg) = False

BECOME:
======

runas:
_____
become_user(/MY_PROJECT/ansible/ansible.cfg) = root

su:
__
become_user(/MY_PROJECT/ansible/ansible.cfg) = root

sudo:
____
become_user(/MY_PROJECT/ansible/ansible.cfg) = root

CONNECTION:
==========

paramiko_ssh:
____________
host_key_checking(/MY_PROJECT/ansible/ansible.cfg) = False

ssh:
___
host_key_checking(/MY_PROJECT/ansible/ansible.cfg) = False
scp_if_ssh(/MY_PROJECT/ansible/ansible.cfg) = True
timeout(/MY_PROJECT/ansible/ansible.cfg) = 60
```


### OS / Environment

Ubuntu 22.04

### Steps to Reproduce

Playbook 1 (pause will be prompted once with flush_handlers, then 2 more times at the end of the play)

```yaml
- hosts: all
  handlers:
    - name: Ping again
      pause:
        prompt: Please ping
  tasks:
    - name: Update something
      notify: Ping again
      changed_when: yes
      ping:

    - name: Flush handlers
      meta: flush_handlers
```

Playbook 2 (ping handler will be executed twice)

```yaml
- hosts: all
  handlers:
    - name: Ping again
      run_once: yes
      ping:
  tasks:
    - name: Update something
      notify: Ping again
      changed_when: yes
      ping:
```

Playbook 3 (ping handler will be executed once with flush_handlers, then 2 more times at the end of the play)

```yaml
- hosts: all
  handlers:
    - name: Ping again
      run_once: yes
      ping:
  tasks:
    - name: Update something
      notify: Ping again
      changed_when: yes
      ping:

    - name: Flush handlers
      meta: flush_handlers
```

### Expected Results

I expect the handler to be run once, no matter the number of hosts

```
PLAY [all] ***********************************************************************************************************************************************

TASK [Update something] **********************************************************************************************************************************
changed: [host4]
changed: [host2]
changed: [host1]
changed: [host3]

TASK [Flush handlers] ************************************************************************************************************************************

TASK [Flush handlers] ************************************************************************************************************************************

TASK [Flush handlers] ************************************************************************************************************************************

TASK [Flush handlers] ************************************************************************************************************************************

RUNNING HANDLER [Ping again] *****************************************************************************************************************************
[Ping again]
Please ping:
^Mok: [hostX]

PLAY RECAP ***********************************************************************************************************************************************
host1                        : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
host2                        : ok=1    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
host3                        : ok=1    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
host4                        : ok=1    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
```

### Actual Results

```console
PLAY [all] ***********************************************************************************************************************************************

TASK [Update something] **********************************************************************************************************************************
changed: [host4]
changed: [host1]
changed: [host2]
changed: [host3]

TASK [Flush handlers] ************************************************************************************************************************************

TASK [Flush handlers] ************************************************************************************************************************************

TASK [Flush handlers] ************************************************************************************************************************************

TASK [Flush handlers] ************************************************************************************************************************************

RUNNING HANDLER [Ping again] *****************************************************************************************************************************
[Ping again]
Please ping:
^Mok: [host2]

RUNNING HANDLER [Ping again] *****************************************************************************************************************************
[Ping again]
Please ping:
^Mok: [host4]

RUNNING HANDLER [Ping again] *****************************************************************************************************************************
[Ping again]
Please ping:
^Mok: [host3]

PLAY RECAP ***********************************************************************************************************************************************
host1                      : ok=1    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
host2                      : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
host3                      : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
host4                      : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
#
#
#
#
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
    name: linear
    short_description: Executes tasks in a linear fashion
    description:
        - Task execution is in lockstep per host batch as defined by C(serial) (default all).
          Up to the fork limit of hosts will execute each task at the same time and then
          the next series of hosts until the batch is done, before going on to the next task.
    version_added: "2.0"
    notes:
     - This was the default Ansible behaviour before 'strategy plugins' were introduced in 2.0.
    author: Ansible Core Team
'''
from ansible import constants as C
from ansible.errors import AnsibleError, AnsibleAssertionError, AnsibleParserError
from ansible.executor.play_iterator import IteratingStates, FailedStates
from ansible.module_utils.common.text.converters import to_text
from ansible.playbook.handler import Handler
from ansible.playbook.included_file import IncludedFile
from ansible.playbook.task import Task
from ansible.plugins.loader import action_loader
from ansible.plugins.strategy import StrategyBase
from ansible.template import Templar