XWIKI-8930: Deleting an attachment should send an event
* don't save the document when removing an attachment with merge
* fix tests
(cherry picked from commit 0e3b0b6ce5b12744afd7c6f7fdeae7f167044b1e)