(PUP-2946) File2 with #compare_stream from 1.9.3

FileUtils.compare_stream in Ruby 2 is broken when comparing
binary file stream with StringIO stream of different encoding.

This change reverts FileUtils.compare_stream to stdlib v1.9.3
implementation.
(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
(maint) Use rspec :if to constrain describe block
Merge branch 'pull-2938'
(maint) Use public API when testing binary file #save
(maint) Dup frozen File content strings

Commit 2a9e996 froze all string tokens in the lexer as a performance
tweak. This caused a regression in file content behavior where

file { '/tmp/foo': content => stuff }

would fail with a 'Error: Could not set content on file: can't modify
frozen String' when using the future parser on Ruby 1.9.3 and up.  The
Ruby version requirement was because we force_encoding to ASCII_8BIT on
platforms (1.9.3 and up) which allow this, but you can't do that to a
frozen string.  This was failing in the lib/puppet/type/file/content.rb
should= method, where the string was cloned, but a clone() clones the
frozen state.

Other Types, including user defined types, may override should= or munge
and have similar problems, so we are adding a convert_String to the
runtime3_support to step around this problem.  This still leaves the
basic problem of mutation of strings within resource instances, but that
is pre-existing.
Merge pull request #2942 from jpartlow/maint/master/frozen-strings-breaking-file-type

(maint) Dup frozen File content strings
Merge remote-tracking branch 'upstream/master' into puppet-4

* upstream/master:
  (maint) Dup frozen File content strings
  (maint) Use public API when testing binary file #save
  (maint) Use rspec :if to constrain describe block
  (PUP-2924) Set resource_type when retrieving state
  (PUP-2946) File2 with #compare_stream from 1.9.3