Make listify respect the global setting for undefined variables.

(Fixes #9008.)

With credit to jimi-c for the initial pass in this commit:
https://github.com/jimi-c/ansible/commit/b18bd6b98edecda1fcb5a85053593e78b46b9709
Merge pull request #9286 from damncabbage/9008-undef-var-in-list

Makes listify_lookup_plugin_terms respect the global setting for undefined variables.