(#9459) Fix problems with Windows 'user' and 'group' providers.
This commit corrects several problems with the Windows 'user' and
'group' providers, Puppet::Util::ADSI helper class.
The 'user' provider failed to add the username to the set of groups
specified in the 'groups' property when creating a new user, due to
the provider trying to enumerate a user's group membership before the
underlying ADSI user object was saved. Any group referenced in the
property must exist prior to creating the resource.
The 'group' provider failed to save a newly-created resource, due to a
missing 'flush' method, which in turn calls the
'Puppet::Util::ADSI.commit' (save) method. It also had the same
problem when creating a new group and trying to add members to it,
before the underlying ADSI group object was saved.
Windows does not allow user and groups to share the same name,
and when attempted the ADSI connection would throw a misleading
exception referring to an 'invalid moniker'. The 'user' provider will
now raise an error if it attempts to create a resource when a like-named
group already exists, and vice-versa.
Spec tests were updated to reflect code changes. Added expectation
sequence to ensure newly created users and groups are committed before
making the ADSI connection.