Removed libsz, added thread-safe option