[source/git] (GH-178) Use memoized environment method

When r10k was preloading a git source and the initial sync failed, it
would not prepopulate the `@environments` variable. This should
nominally be fine because the environments method should have lazily
generated the environments generated from the cached repo, but the
method used for enumerating the contained directories was bypassing lazy
enumeration and finding an empty array. This in turn would indicate that
no environnments were present and thus would wipe out all environments.

This commit changes the contents enumeration to use the lazy method
instead of directly using the environment variable.
(maint) Refactor for style and clarity
Merge branch 'bugfix/1.3.x/gh-178-bad-purge-on-failure' into 1.3.x