use preDelete instead of postDelete hook

:warning::warning::warning: DO NOT MERGE YET :warning::warning::warning:

use preDelete instead of postDelete hook.
requires https://github.com/owncloud/core/pull/7668 and https://github.com/owncloud/core/pull/7669 to be merged