(maint) Fix acceptance test for scheduled_task deletion

This test was accidentally checking that the scheduled task was still in
place in the Windows scheduled task list. Because the
Win32::TaskScheduler#delete call seems to be asynchronous, as long as
the test for scheduled task happened fast enough, it was still seen as
present and the test 'passed'.  In fact, puppet resource was scheduling
the task to be removed, and it does get removed.  This test began to fail
when the vms slowed down enough that the broken verification step began
to fail because it was no longer executing fast enough to see the
transient task prior to its deletion completing.

This change corrects the verification step to verify by asserting that
the schtasks.exe list command failed (did not show the deleted task).
And it wraps it in a timeout to allow it a few seconds for the scheduled
tasks state to finalize.
(maint) Correct documentation of each function

The documentation of the each function used deprecated syntax.
PUP-1322 Do not fail hard on unparseable files
Merge pull request #2256 from jpartlow/maint/stable/fix-scheduled-task-delete-acceptance

(maint) Fix acceptance test for scheduled_task deletion
(PUP-1389) Ensure wide strings have double null terminators

It seems that calling String#encode('UTF-16LE') sometimes adds only a single
NULL terminator in both ruby 1.9 and 2.0 on Windows. However, a wide string
is supposed to have two NULL terminators.

For reasons unknown, versions prior to 2012 seem to accept wide strings with
only a single NULL terminator, but in 2012 and 2012R2 the string is often times
contains a non-zero high byte, which causes Windows to read past the single
terminator, and attempt to access a path that does not exist.
(PUP-1389) ReplaceFile to FFI / move wide_string

Puppet::Util::Windows::File.replace_file now calls FFI to
replace files in place on Windows.
Puppet::Util::Windows::File.wide_string has now been moved to
Puppet::Util::Windows::String.wide_string.

This moves wide_string to lib/puppet/ubilt/windows/string.rb,
adds specs concerning different encodings.

In addition, we've removed Windows::API::WideString usages from
everywhere it was found as it is known to cause issues with Windows 2012.
Puppet::Util::Windows::Process.lookup_privilege_value in particular was
changed to use LookupPrivilegeValueA (ANSI) as we control the privilege name
being passed to it.

Paired with Josh Cooper <josh@puppetlabs.com>
(PUP-1389) Simplify logic for appending extra NULL

This commit simplifies the process for appending a NULL terminator to
the wide string.
Merge branch 'pr/2261' into stable

* pr/2261:
  (PUP-1389) Simplify logic for appending extra NULL
  (PUP-1389) ReplaceFile to FFI / move wide_string
  (PUP-1389) Ensure wide strings have double null terminators
(PUP-1389) Embed the extra NULL within the string

Previously, we were appending a NULL to the wide encoded string to work around
a ruby bug fixed in 2.1.

However, we were calling `String#strip`, which makes a copy of the string, and
in the process only preserves the first NULL.

This commit embeds a NULL within the string itself, e.g. "bob\0". Since the
NULL is part of the string data, ruby will preserve it.

Also, `String#+` cannot combine strings with different encodings,
e.g. "a".encode('UTF-16LE') + "\0" results in:

    incompatible character encodings: UTF-16LE and US-ASCII

which is why we need to encode the terminator. The actual message depends on
the default encoding, e.g. US-ASCII, UTF-8.
(PUP-1389) Merge branch 'issue/stable/PUP1389-segfault' into stable
(PUP-1406) Add ability to override default system confdir and vardir

Without this patch it's difficult to change the behavior of determining
the default confdir and vardir settings.  This is a problem because it's
difficult to relocate Puppet which is necessary in certain cases, such
as Puppet Enterprise and our Ops team using /etc/operations/puppet as
the default confdir.

This patch exposes a public API to allow third party tools to easily
determine the file to write to override the default confdir and vardir.
The API method is Puppet::Util::RunMode.override_path(type) where type
is either "confdir" or "vardir"  An anticipated use case is that a
simple rubygems plugin gem could register a post_install hook to write
an override file which will relocate puppet.

A path relative to the gem source file has been chosen to facilitate
multiple copies of the Puppet library being installed and relocated to
their own isolated paths or gemset.