Catch preupgrade exception

Fixes https://github.com/owncloud/apps/issues/1863