(#9546) Update configurer_spec for external facts pluginsync.

Prior to the #9546 work, there was only one download of plugins,
and now there may be two.  Update the configurer_spec to reflect
that change.
(#9546) Check that :pluginfactdest is a directory before using it

The #9546 work added the :pluginfactdest setting but didn't validate
that it was in fact a directory.  This adds that validation.  The
validation allows spec tests to pass, and it also covers the case
of someone mistakenly entering an incorrect path for this setting.
(#9546) Correct a typo in a setting desc.
(Maint) Provide a timeout when trying to aquire a file lock

It is possible that the process is never able to aquire a lock. In that
case we don't want to block the process forever. There was also a
horrible performance characteristic from doing a busy loop while waiting
for the lock.
(#693) Test parallel certificate autosigning

This tests shows the case of multiple certificates being requested at
the same time with autosigning enabled. There are multiple different
ways that it fails: duplicate and lost serial numbers, attempts to
remove CSRs that have already been removed, incorrect file locking
(#693) Remove race conditions in autosigning code

This removes the autosigning attempt at signing all outstanding CSRs at
the same time, which removes contention between processes that are
submitting CSRs and then autosigning. It also properly locks and updates
the serial number file so that there is no more chance of duplicate
serial numbers.
(#9546) Add windows and non-windows variants of one test.
Merge pull request #1966 from jantman/fix/master/issue22660

Issue #22660
(#693) Remove unused locking code, update timings

We don't need the import lock methods; however, the timings they used
make more sense than what we had originally. Some of the timing steps
have been brought over to the exclusive_open method.
(Maint) Move opening functionality to FileSettings

The FileSettings class should expose some behavior for interacting with
the file that the setting represents. This allows settings to become
smaller and the responsibilities to be better distributed.
(#22992) Correct wrong exit code when testing state.yaml

Additionally removes an old typo
Merge branch 'samyboy-master'

* samyboy-master:
  (#22992) Correct wrong exit code when testing state.yaml

Closes GH-2014
Merge pull request #1984 from udoprog/lib-shebangs

(maint) Remove shebangs from *.rb files in lib
Merge branch 'lib-permissions' of https://github.com/udoprog/puppet into udoprog-lib-permissions
Merge branch 'readme-ruby-2_0' of https://github.com/jhoblitt/puppet into jhoblitt-readme-ruby-2_0
(#22858) Note that ruby 2.0.0 should be at least p195.
(#21874) Fix failing validation.

Validation of deprecated resource references using QualifiedName
(i.e. a lower case bare word) instead of QualifiedReference (i.e.
an upper cased bare word) should have accessed the `value` of the
instructions `left_expr`, but instead did this on the instruction
itself.

This fixes one part of the issue #21874 which gives users a better clue
how to work around the issue.
Merge branch 'master' of ssh://github.com/puppetlabs/puppet.git
(#693) Update spec tests for change impl

These tests are aggrevating. They are very tied to the implementation
and have almost not explanation of what features and behaviors are
available.
(Maint) Move write and writesub to Setting

Just like readwritelock, the write and writesub belong better on the
setting classes. This moves write to FileSetting as open and writesub to
DirectorySetting as open_file