Fix locks upgrade.
Fix upgrades check logic.
Actually we use 1.3.0 for this version.
Ignore isolated variables in the solver.
Add pkg_version_change_between function.

This function is intended to compare changes between two packages
passed. Its return value is similar to pkg_version_change.

Converted utils.c in pkg to use new API.

Fixed style a bit while I'm here.
Fix pkg self upgrade.
Another upgrade fix.
Upgrade fetching fix.
Fix deletion in case of upgrade.