(PUP-751) Preserve environment across resource copy

The resource's environment was lost when a copy was made. This caused
the type information to be looked up again, from scratch, as well as a
total loss of the associated environment information (it would switch
from one environment to another). By preserving the environment any
calls to resource_type, or other methods that require the environment,
are much faster.

This also preserves the rstype cache of the resource_type to cut down
the looks a slight amount more.

Here is the breakdown of the speedups to this point on my machine:

Initial(bca4d4e):
> total:     7.520000   1.250000   8.770000 (  8.789636)
> avg:       0.752000   0.125000   0.877000 (  0.878964)

Prefer defined types(2617d61):
> total:     7.150000   1.170000   8.320000 (  8.326319)
> avg:       0.715000   0.117000   0.832000 (  0.832632)

Preserve environment(3f8e94c):
> total:     6.170000   0.860000   7.030000 (  7.057820)
> avg:       0.617000   0.086000   0.703000 (  0.705782)

I also tried to change the order of loading in
Puppet::Parser::Scope#find_resource_type to have it look for defined
types first, but that resulted in an overall slowdown:

> total:     6.740000   0.730000   7.470000 (  7.476968)
> avg:       0.674000   0.073000   0.747000 (  0.747697)