Fix bugs with char/word limit snapshot implementation

The issue was caused by a delay between the firing of the
snapshot event relative to when the snapshot was last saved
(the contents of which were used in "undo-ing" the typing.
It was possible to exceed the character limit when typing
quickly or copy-pasting quickly.

From callahat/CKEditor-WordCount-Plugin@6118523