public.php - check if maintenance mode is enabled

check if maintenance mode is enabled 
see https://github.com/owncloud/core/issues/3213

please review @MTGap @icewind1991 @DeepDiver1975