(Maint) Convert to new block expects
(#22471) Rescue errors specific to the YAML parser

The different yaml parsers, which are used in different versions of
ruby, end up throwing incompatible errors when loading data. The
Psych::SyntaxError that is thrown by the ruby 1.9 Psych parser is not
catchable by a generic `rescue => detail` block. Instead it needs to
explicitly call out the errors that need to be rescued.

This duplicates the error logic in Puppet::Indirector::Yaml.
(Maint) Simplify code

There was some unused code, overly complicated conditionals, and a use
of YAML that didn't use the built in writing to a stream.
(Maint) Stop asserting nothingness

Assertions that something doesn't raise an error, are not normally very
useful. In the case of these tests they only served to obscure the test
that was actually being done.
(#22471) Extract YAML interaction into shared code

The extra logic that is needed to interact with both Psych and Syck was
duplicated in the Puppet::Util::Storage and Puppet::Indirector::Yaml
classes. This pulls out a common module that wraps YAML and provides
consistent, and safe, semantics for using YAML for reading and writing.

This also removes the check ofr ::ArgumentError in addition to
::StandardError because it seems that ::ArgumentError is a sublcass of
::StandardError.
(#22471) Remove duplication by using Puppet::Util::Yaml

The new Puppet::Util::Yaml provides a common way of dealing with YAML
differences across ruby versions. This changes to two places in the
codebase that cared about these differences to use this common code.
(#22471) Finish removing duplication of yaml exceptions

Remove a bit of code wasn't cleaned up but was no longer used.
Merge branch 'issue/stable/22471-corrupt-state-yaml' into stable

* issue/stable/22471-corrupt-state-yaml:
  (#22471) Finish removing duplication of yaml exceptions
  (#22471) Remove duplication by using Puppet::Util::Yaml
  (#22471) Extract YAML interaction into shared code
  (Maint) Stop asserting nothingness
  (Maint) Simplify code
  (#22471) Rescue errors specific to the YAML parser
  (Maint) Convert to new block expects