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.
Merge pull request #541 from mjs/are-upgrades-defined

Added updates.AreUpgradesDefined

Two bits:

1. Adds upgrades.AreUpgradesDefined which returns if there are upgrade operations defined between the version specified and the running software version. 
2. Use AreUpgradesDefined in the machine agent to decide whether upgrade mode should be entered. 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.