Hide sharing sections in files app when sharing API is disabled

Backport of 1de5ae8845393be599e543efde45d22db989658a from master
Extend OC_Util::needUpgrade to also catch app upgrades
Throw an exception when we try to load an app that needs to be upgraded
handle service not available exceptions in index, remote and public.php
extract upgrade parts to their own methods
Allow loading app without checking the upgrade
Send feedback from upgrading apps to the upgrade ui
Also set the app version when updating from app store
Set maintaince mode when updating an app from the app store
only set core version at the end
fix undefined variable
fix multiselect bar offset on shared page
Merge branch 'stable7-upstream' into stable7-rotdrop