This makes sure that folders are moved to trash when deleted with
rmdir() instead of unlink().
This happens for example when deleting a folder over WebDAV.
The web UI uses unlink() so it wasn't affected.
After a failed rename, the post_rename hook is not called.
This quickfix makes sure the trashbin storage logic is reenabled
also after a failed rename.
In the case of cross-storage delete, the files are copied to the trash,
then deleted. The final delete on the source storage would still reach
the trash wrapper.
This fix makes forwards that second call to the wrapped storage to make
the final delete work.
It fixes the issue with remote shares, local shares and external
storage.
Also, it uses a new function "renameRecursive" that renames the files
and preserves the mtimes (like "copy_recursive" did in the past))