[WIP] Fix some gems not getting resolved #2532 and 2464

When there is a conflict because of an activated gem
we shouldn't blindly try and backtrack to parent
of current gem (which is conflicting). If there
are no other versions of parent available, it will
lead to dead end.

In which case try backtracking to gem that originally
activated the conflicting gem.