[Resolver] Fix handling of pre-release specs

This was tough to do, since it really adversely affected performance on unresolvable podfiles. Hence the optimization of making sure that a pod's dependencies with the same root name are pinned to the same version in `dependencies_for`

\c @kylef, @alloy