XWIKI-10036: It's possible to modify a document without getting a new entry in the history

(cherry picked from commit d1f7107326eed67aa707c2fa662e303127dcb313)