(#4506) Don't serialize transient vars in Puppet::Resource

When serializing Ruby objects to YAML, Procs may be serialized that
cannot be deserialized. Given the following example:

    YAML.load(YAML.dump lambda { "hi" })

A TypeError is raised with the message "allocator undefined for Proc".

Commit e161cbc introduced a new instance variable to Puppet::Resource,
`@rstype`, which was the serialized resource_type for the given object.
When a Puppet::Resource object was round tripped from YAML the
deserialization would fail with the above TypeError. Using Puppet's
built in deserialization (EG `Puppet::Resource.convert_from('yaml', serialized_data)`)
would work, but directly parsing the YAML would fail.

To resolve this an explicit list of instance variables is specified for
serialization, so instead of trying to serialize everything we only
serialize the things we need.

This supersedes GH-1868.