declare_dependency: fix regression in printing the correct error
declare_dependency: fix regression in printing the correct error

In commit 47426f3663f795ae9af59075297bf8215ae81f40 we migrated to
typed_kwargs, but the validator accepted a list and checked to see if it
was a single Dependency object.

Fixes #10813

pexip/meson,mesonbuild/meson,mesonbuild/meson,pexip/meson,pexip/meson,mesonbuild/meson,pexip/meson,mesonbuild/meson,pexip/meson,pexip/meson,mesonbuild/meson,pexip/meson,pexip/meson,mesonbuild/meson,mesonbuild/meson,mesonbuild/meson,pexip/meson,mesonbuild/meson,pexip/meson,mesonbuild/meson