added a lock to prevent segmentation fault on multi-threaded access to libhunspell