CB-6028: Protect against cyclic dependencies in install

This change aims to fix https://issues.apache.org/jira/browse/CB-6028 - If two or more plugins form a loop in their dependency graph, then attempting to install one of them with plugman enters an infinite loop and never finishes the installation.