Count "core" and "local" in the "toupgradecount" for check_upgrades()

Bug 1401313: The "toupgradecount" was only counting plugins, not core
and local. This specifically caused problems for the command-line upgrade
script.

Change-Id: Ia7b666af890d84613ed34f0c72f395c77fdad358
Merge "Count "core" and "local" in the "toupgradecount" for check_upgrades()"