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

(cherry picked from commit cb9545e067c25ae2e58a0f73314ae5a2ba9f8b9d)