Fixes #4645 Maintenance mode

Elgg 1.9 does not work well pre-upgrade on a 1.8 db (river change cause exceptions on adding/removing entities). We really need a maintenance mode so here it is.