In some cases HistoryItem::attachToBlock was not calling
History::setHasPendingResizedItems (if it was not pending resize).
That could lead to addition of a whole block of items without
setting pending resize for the history and it violated the history
invariant of the _blocks y/height and their _items y/height.
Now each time we attachToBlock an item we also setPendingResize it.