EZP-23249

This fork has the code from:
https://github.com/ezsystems/ezpublish-legacy/pull/1078#issuecomment-56054814

which fixes:
https://jira.ez.no/browse/EZP-23249

with minor changes that prevent the setup wizard from failing when choosing 'Remove existing data' from the database.