Fix possible crash in spell check

Closes #1048
Merge https://github.com/hexchat/hexchat into cpp-dev