solver3: Do not prefer new installs over manually installed obsoletes
Only move obsolete packages last that are automatically installed, as we don't want to remove manually installed obsolete packages.
Add some missing const annotations to the operator[] arguments as well that were needed.
LP: #2100247