Prevent loadApps on upgrade

Moved OC::needUpgrade() to OCP\Util::needUpgrade() to make it accessible
form the router.
Moved maintenance + upgrade check to the router.
Merge pull request #8974 from owncloud/router-preventloadappsonupgrade

Prevent loadApps on upgrade