### Summary

Triggering handlers with `ansible.builtin.meta: flush_handlers` in a role results in an error

### Issue Type

Bug Report

### Component Name

meta

### Ansible Version

```console
$ ansible --version
ansible [core 2.14.0b2]
  config file = /home/twouters/.ansible.cfg
  configured module search path = ['/home/twouters/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/twouters/ansible-2.14/lib/python3.10/site-packages/ansible
  ansible collection location = /home/twouters/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/twouters/ansible-2.14/bin/ansible
  python version = 3.10.7 (main, Sep  6 2022, 21:22:27) [GCC 12.2.0] (/home/twouters/ansible-2.14/bin/python)
  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
```


### OS / Environment

Arch Linux and Debian but probably irrelevant

### Steps to Reproduce

```
$ tree -Ap                   
[drwx------]  .
├── [drwxr-xr-x]  testrole
│   ├── [drwxr-xr-x]  handlers
│   │   └── [-rw-r--r--]  main.yml
│   └── [drwxr-xr-x]  tasks
│       └── [-rw-r--r--]  main.yml
└── [-rw-r--r--]  test.yml

3 directories, 3 files
```

```
$ cat test.yml 
- hosts: localhost
  pre_tasks:
    - ansible.builtin.command: /bin/true
      notify: do nothing
  handlers:
    - name: do nothing
      ansible.builtin.debug:
        msg: hello
  roles:
    - testrole
```

```
$ cat testrole/tasks/main.yml    
---

- ansible.builtin.command: /bin/true
  notify: noop

- ansible.builtin.meta: flush_handlers

- ansible.builtin.command: /bin/true
```

```
$ cat testrole/handlers/main.yml 
---

- name: noop
  ansible.builtin.debug:
    msg: world
```

### Expected Results

I expect the play to succeed and trigger the handler

```
$ ansible-playbook test.yml -l localhost
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost
does not match 'all'

PLAY [localhost] ***************************************************************************************

TASK [Gathering Facts] *********************************************************************************
ok: [localhost]

TASK [ansible.builtin.command] *************************************************************************
changed: [localhost]

RUNNING HANDLER [do nothing] ***************************************************************************
ok: [localhost] => {
    "msg": "hello"
}

TASK [testrole : ansible.builtin.command] **************************************************************
changed: [localhost]

TASK [testrole : ansible.builtin.meta] *****************************************************************

RUNNING HANDLER [testrole : noop] **********************************************************************
ok: [localhost] => {
    "msg": "world"
}

TASK [testrole : ansible.builtin.command] **************************************************************
changed: [localhost]

PLAY RECAP *********************************************************************************************
localhost                  : ok=6    changed=3    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
```

### Actual Results

```console
$ ansible-playbook test.yml -l localhost           [WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost
does not match 'all'

PLAY [localhost] ***************************************************************************************

TASK [Gathering Facts] *********************************************************************************
ok: [localhost]

TASK [ansible.builtin.command] *************************************************************************
changed: [localhost]

RUNNING HANDLER [do nothing] ***************************************************************************
ok: [localhost] => {
    "msg": "hello"
}

TASK [testrole : ansible.builtin.command] **************************************************************
changed: [localhost]

TASK [testrole : ansible.builtin.meta] *****************************************************************
ERROR! BUG: There seems to be a mismatch between tasks in PlayIterator and HostStates.
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
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._text 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
from ansible.utils.display import Display
display = Display()
class StrategyModule(StrategyBase):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        
        self._in_handlers = False
    def _get_next_task_lockstep(self, hosts, iterator):
        '''
        Returns a list of (host, task) tuples, where the task may