use preDelete instead of postDelete hook

better implementation as discussed in https://github.com/owncloud/core/pull/7670

please review @PVince81 @schiesbn 

fixes https://github.com/owncloud/core/issues/7630