(#21409) Ensure that create_resources acts the same as a resource decl

The previous implementation of create_resources duplicated most of the
logic of Puppet::Parser::AST::Resource, but had variations which meant
that it didn't actually behave the same. This lead to the possibility that
what should have been equivalent statements in the language did not always
result in the same catalog. This re-implements create_resources to
construct the AST that is needed to create the requested resources and
evaluate the resulting structure. This should only be able to differ from
actual resource declarations in the language if the constructed AST is
wrong.

There is unfortunately no specific test for the issue reported in 21409 because
it is a problem of iteration order of a hash. The fix was verified, however, by
reproducing the problem on a system specified in the issue and then verifying
that the new function produces the desired result.