Catch UnicodeDecodeError from search thread
Stop search-replace threads when closing