Fix EZP-22519: Number of history items regression

Link : https://jira.ez.no/browse/EZP-22519

This PR fixes a small regression introduced in #922 and as you can see in comments, @andrerom was right to be worried :)

## Description
After fixing EZP-22519 the number of maximum items was not respected. It was missing one item because we are doing the check after the creation instead of before.

## Tests
Manual tests