Fix probably theoretical bug
Try to work around bugs in pthread library on Windows