ticketed lock implementation

with this, a thread will be able to yield a lock to another thread

this is needed to make multithread work on Windows as the original LRZIP implementation is relying on pthreads undefined behavior.