Fix issue #1078
iOS & OS X: Fix error in cleanup (ObjectDB Instances still exist!)