spellcheck: Fix crash when closing a document quickly after adding data to it

When using timeout callbacks, we need to check the documents are still valid
in the callbacks, in the case they e.g. have been closed since the timeout
started.
Merge pull request #129 from b4n/spellcheck/fix-timeout-callback

spellcheck: Fix crash when closing a document quickly after adding data to it