Simulate apps database schema update on upgrade

When upgrade, also simulate the database schema update for apps before
doing the actual upgrade.
Removed simulate db update flag and split into separate methods
Do not load apps when upgrade is needed

This prevents routes like "core/js/oc.js" to automatically load apps and
trigger their update prematurely.
Merge pull request #8878 from owncloud/update-checkmigrationforapps

Simulate apps database schema update on upgrade