(PUP-1563) resolve_install_conflicts excessively recurses

Previously, resolve_install_conflicts was called from inside the
modules_by_path iterator causing each module and its dependencies to be
checked for conflict for each installed module, even if the installed
module was completely unrelated. With a tree of dependencies and dozens
of previously installed modules, this walk can take hours.

This patch fixed the problem by moving the recursion outside of the
modules_by_path iterator loop.
(PUP-1563) Don't recurse when dependencies are empty

Previously we would recurse for each leaf dependency unnecessarily.

This commit ensures we only recurse if we have a non-empty set of
dependencies, and adds a debug message when conflicts are checked.

It also adds a spec tests to ensure we evaluate each module for
conflicts only once.

Paired-with: Josh Partlow <joshua.partlow@puppetlabs.com>
Merge branch 'pr/2322'

* pr/2322:
  (PUP-1563) Don't recurse when dependencies are empty
  (PUP-1563) resolve_install_conflicts excessively recurses

Closes GH-2322