Better error report on cyclic upgrade
Actions processing: finer handling of deps among versions

Fixes  #1778
Fixed exit code on upgrade resolution error
Merge pull request #1798 from OCamlPro/1.2

Backport finer computing of actions to avoid cycle errors