<!--- Verify first that your issue is not already reported on GitHub -->
<!--- Also test if the latest release and devel branch are affected too -->
<!--- Complete *all* sections as described, this form is processed automatically -->

##### SUMMARY
<!--- Explain the problem briefly below -->
Using loops with dict2items fails even when task should be skipped by conditional.

##### ISSUE TYPE
- Bug Report

##### COMPONENT NAME
<!--- Write the short name of the module, plugin, task or feature below, use your best guess if unsure -->
dict2items filter
##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes -->
```
ansible --version
ansible 2.9.9
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /var/lib/awx/venv/ansible-2.6.4/lib/python2.7/site-packages/ansible
  executable location = /var/lib/awx/venv/ansible-2.6.4/bin/ansible
  python version = 2.7.5 (default, Apr  2 2020, 13:16:51) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
```

##### CONFIGURATION
<!--- Paste verbatim output from "ansible-config dump --only-changed" between quotes -->
```
ansible-config dump --only-changed
GALAXY_SERVER_LIST(/etc/ansible/ansible.cfg) = [u'official_galaxy']
```

##### OS / ENVIRONMENT
<!--- Provide all relevant information below, e.g. target OS versions, network device firmware, etc. -->
CentOS 7.8

##### STEPS TO REPRODUCE
<!--- Describe exactly how to reproduce the problem, using a minimal test-case -->
Run this playbook

<!--- Paste example playbooks or commands between quotes below -->
```
- hosts: localhost
  gather_facts: false
  tasks:
    - debug: msg={{item}}
      with_dict: '{{myundef}}'
      when:
       - myundef is defined
    - debug: msg={{item}}
      loop: '{{myundef|dict2items}}'
      when: 
       - myundef is defined
      

```

<!--- HINT: You can paste gist.github.com links for larger files -->

##### EXPECTED RESULTS
<!--- Describe what you expected to happen when running the steps above -->

Expected that both tasks are skipped as conditional is not met.

##### ACTUAL RESULTS
<!--- Describe what actually happened. If possible run with extra verbosity (-vvvv) -->

<!--- Paste verbatim command output between quotes -->
```
ansible-playbook 2.9.9
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /var/lib/awx/venv/ansible-2.6.4/lib/python2.7/site-packages/ansible
  executable location = /var/lib/awx/venv/ansible-2.6.4/bin/ansible-playbook
  python version = 2.7.5 (default, Apr  2 2020, 13:16:51) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
Using /etc/ansible/ansible.cfg as config file
setting up inventory plugins
host_list declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
script declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
auto declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Parsed /etc/ansible/hosts inventory source with ini plugin
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not
match 'all'
Loading callback plugin default of type stdout, v2.0 from /var/lib/awx/venv/ansible-2.6.4/lib/python2.7/site-packages/ansible/plugins/callback/default.pyc

PLAYBOOK: test_dict2items.yml ***************************************************************************************
Positional arguments: test_dict2items.yml
become_method: sudo
inventory: (u'/etc/ansible/hosts',)
forks: 5
tags: (u'all',)
verbosity: 4
connection: smart
timeout: 10
1 plays in test_dict2items.yml

PLAY [localhost] ****************************************************************************************************
META: ran handlers

TASK [debug] ********************************************************************************************************
task path: /var/lib/awx/projects/Manual/test_dict2items.yml:4
skipping: [localhost] => {}

TASK [debug] ********************************************************************************************************
task path: /var/lib/awx/projects/Manual/test_dict2items.yml:8
fatal: [localhost]: FAILED! => {
    "msg": "dict2items requires a dictionary, got <class 'ansible.template.AnsibleUndefined'> instead."
}

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

return self.message
    def __repr__(self):
        return self.message
    def _get_error_lines_from_file(self, file_name, line_number):
        '''
        Returns the line in the file which corresponds to the reported error
        location, as well as the line preceding it (if the error did not
        occur on the first line), to provide context to the error.
        '''
        target_line = ''
        prev_line = ''
        with open(file_name, 'r') as f:
            lines = f.readlines()
            target_line = lines[line_number]
            if line_number > 0:
                prev_line = lines[line_number - 1]
        return (target_line, prev_line)
    def _get_extended_error(self):