upgrades: added AreUpgradesDefined

This function return true if there are upgrade operations defined
between the version specified and the running software version. The
logic shared by this and PerformUpgrade has been extracted to an
iterator.
Use AreUpgradesDefined to decide agent if upgrade mode is needed

This moves the decision of whether an upgrade mode should be entered
to the upgrades package (where it should be) and also means upgrade
mode is only entered if there are actually upgrade steps defined.