fix mem leak.
check if tree writes are disabled and block
until not when deleting/resetting a collection.
just like we do it tree is being saved.