Return 503 in  public.php and OCS API when upgrade is due

To prevent unexpected behavior, public.php and the OCS API calls will
return 503 Service Unavailable when an upgrade is due.

Hopefully fixes cases like https://github.com/owncloud/core/issues/9295

Please review @jancborchardt @DeepDiver1975 @karlitschek @icewind1991 
response should be in the expected format - in this case xml or json