(#22740) create_resources input validation

Currently, Puppet's `create_resources()` function only validates that
the number of arguments. However, the function expects a hash for the
second argument, and Puppet explodes with an unhelpful error if the
second argument is not a hash, or nil.

For example, if the second argument is a string, you'll receive
something along the lines of `undefined method `each' for "":String at
/etc/puppetlabs/puppet/manifests/site.pp:45`. This is less than helpful
for users.

This patch raises an argument error if the second argument is not a
hash, warning the user that it should be.

Also adds input validation for optional third argument of create_resources,
and added a test to match.