(PUP-2924) Set resource_type when retrieving state

Instances of `Puppet::Resource` will follow a very expensive code path when
asked to retrieve their `resource_type`. In the case of whits, this results in
an exhaustive search as Whit types have unique per-instance names that never
map to an on-disk implementation as Ruby code.

This patch avoids some of this work by having the `Puppet::Type#retrieve`
method set `resource_type` to `self.class` after creating a Resource instance.
Merge pull request #2929 from Sharpie/pup-2924-searching-for-whits

(PUP-2924) Set resource_type when retrieving state