(#15560) Refactor LogonUser

Previously, the ADSI utility code validated a user's password by
attempting a network logon session as that user. However, the ability to
create a logon session and use the resulting process token is something
that is generally useful, in say the next commit.

This commit refactors the call to `LogonUser`, adds a helper method for
checking the validity of a password, and modifies the ADSI code to call
it.

The call to `LogonUser` remains the same except that the MSDN docs say to
specify a '.' as the domain for local user accounts, and we null out the
token handle prior to calling LogonUser instead setting it to
"\x20\x20\x20\x20" which could be interpreted as a valid handle.
(#15560) Create the user's profile if managehome is true

Previously, specifying `managehome => true` on a user resource would have
no effect even though the Windows ADSI user provider claimed to support
the `manages_homedir` feature.

On Windows, a user's homedir (profile) is not created when the user
account is created, but when the user logs in for the first time. As
a result, if Puppet created the user account, and then tried to apply
another resource that depended on the existence of the user's home
directory, such as ssh keys, then Puppet would fail.

This commit changes the Windows ADSI user provider such that if
`managehome` is enabled, then it will load and unload the user's profile.
This will create the profile if necessary and apply the appropriate DACL
to the profile and subdirectories.

This commit follows the Microsoft recommended way of creating a user
profile: http://support.microsoft.com/kb/196070/en-us
(#15560) Delete user's profile after deleting account

Previously, if Puppet deleted a user account and `managehome` was true,
then Puppet would leave behind the user profile on disk, e.g.
C:\Users\%USERNAME%.

In keeping with the semantics of the `manage_homedir` feature, this commit
modifies the Windows ADSI user provider to delete the user profile when
`managehome` is true.

On systems before Vista SP1, the Win32_UserProfile class does not exist.
Worse, there is no reliable and built-in way to delete user profiles.
There is the widely used delprof.exe utility included in the 2003 Resource
Kit, but it's not part of the core OS and it doesn't work in later
versions of Windows.

As a result, the Windows ADSI provider will make a best effort to delete
the user profile, and that should work on Vista SP1 and later systems. On
earlier systems, we will warn that it's not supported.

This commit also adds an acceptance test to verify the home directory
gets created, and deleted (on systems that support it).
(#15193) Fix windows failing on unix style paths

Without this patch the windows spec tests are failing because the
resource contains File resources with *nix style absolute paths.  These
paths are not considered absolute on windows, so a simple
File.expand_path converts the relative path to an absolute path on
windows.

This patch should restore the build to green.
Merge branch 'fix/2.7.x/15193_fix_windows_spec_failures' into 2.7.x

* fix/2.7.x/15193_fix_windows_spec_failures:
  (#15193) Fix windows failing on unix style paths
Merge pull request #1088 from joshcooper/ticket/2.7.x/15560-managehome-windows

(#15560) Implement manages_homedir semantics on Windows
Don't pollute Functions namespace in shellquote function

This moves two constants into local variables inside the function, as the
constants polluted the Puppet::Parser::Functions namespace and caused warnings
when the function was reloaded.
Backport fix for commandline spec

This makes the commandline spec not try to execute a command that does not
exist.
Don't make executables in /tmp in posix_spec

The posix specs were creating executable files in /tmp, which caused a warning
about an insecure directory in the path. This adds an intermediate safe
directory.