liblzma: Fix another deadlock in the threaded encoder.
liblzma: Fix another deadlock in the threaded encoder.

This race condition could cause a deadlock if lzma_end() was
called before finishing the encoding. This can happen with
xz with debugging enabled (non-debugging version doesn't
call lzma_end() before exiting).

pombreda/go-liblzma,pombreda/go-liblzma,pombreda/go-liblzma