(maint) Add "catalog_memory" benchmark to output heap and show mem info

This adds a benchmark "catalog_memory" that is running an empty catalog
(one call to log). A baseline sample of memory is taken at first run,
and at last. A diff of bound objects is produced. Two heap dumps in json
formats "diff.json", and "heap.json" are produced. The diff contains the
dump of each bound object, and the heap a dump of all objects.

The benchmark also prints basic information about memory.
(maint) Add memwalk.rake task that outputs a graph of bound objects

This adds a command that processes the dumped heap information
produced by "catalog_memory" benchmark (or other similar heap-dumps).

The result is a .dot file that can be rendered.

This tool is useful when tracking a memory leak.
(PUP-3345) Fix memory leak / remove cache of "non-deprecation" resource

A memory leak was introduced by caching all resource types that does
not handle deprecations (all types but one). This caused the problem
because the cache was held as a class instance variable and was never
evacuated.

This changes the Puppet::Resource class to not cache non-deprecation
resources.
(maint) Make catalog_memory a noop unless running on 2.1.0.

This makes the catalog_memory benchmark print a message about
2.1.0 being required and then exit with -1 unless the ruby version
is >= than 2.1.0.
(maint) Fix typo in test name
(PUP-3244) Add a hashbang line to the acceptance test enc

Ruby's Kernel.exec has different behavior on different platforms when
handling a script without a hashbang line. On rhel6, for instance:

[root@a3m9lej0pifviyl ~]# cat /root/test
echo 'foo'
[root@a3m9lej0pifviyl ~]# /root/test arg
foo
[root@a3m9lej0pifviyl ~]# irb
irb(main):001:0> exec('/root/test', 'arg')
Errno::ENOEXEC: Exec format error - /root/test
        from (irb):1:in `exec'
        from (irb):1
        from :0

This seems to depend on how the underlying platforms exec functions
handle this case. Rewriting the enc as a ruby file with a hashbang line
sidesteps this issue and allows the test to run. Also dropped the
environment.conf usage since it seemed superfluous.
(maint) Allow catalog_memory to be skipped on < 2.1.0

The previous attempt to skip catalog_memory on < 2.1.0 caused the `rake
benchmark:all:run` task to abort because of a failed command. By
changing the exit to 0, rake is allowed to continue.
Merge pull request #3188 from hlindberg/PUP-3345-memory-leak

(PUP-3345) Fix memory leak (and add some tooling to find leaks)
Merge pull request #3193 from jpartlow/issue/stable/pup-3244-acceptance-enc-needs-hashbang

Issue/stable/pup 3244 acceptance enc needs hashbang
Merge branch 'issue/stable/pup-3244-acceptance-enc-needs-hashbang' into stable

* issue/stable/pup-3244-acceptance-enc-needs-hashbang:
  (PUP-3244) Add a hashbang line to the acceptance test enc
  (maint) Fix typo in test name
Merge branch 'stable'

* stable:
  (maint) Allow catalog_memory to be skipped on < 2.1.0
  (maint) Make catalog_memory a noop unless running on 2.1.0.
  (PUP-3345) Fix memory leak / remove cache of "non-deprecation" resource
  (maint) Add memwalk.rake task that outputs a graph of bound objects
  (maint) Add "catalog_memory" benchmark to output heap and show mem info
PUP-3457: don't switch uid/gid if already the same

if the uid/gid is already the one we're supposed to switch to, do not
attempt to switch, just return.

fix a now failing #asuser rspec test, thanks @kylog!
add two rspec tests checking for the new functionality.