Fixed bug with wrong state_p unlock: https://github.com/xaionaro/clsync/issues/7