XWIKI-8781: Deleting the last version of a document revert the document, but the revisions are mixed
(cherry picked from commit e5e3d807be70b8012ead1e572f5bd0a2f3b11329)