Add write_lock to KwThreadedSegment
Add write_lock to KwThreadedSegment

Otherwise it is not safe to use. ThreadedSegment does not need write locks.

New variant spends much less time locked in both threads
bezhermoso/powerline,junix/powerline,areteix/powerline,bezhermoso/powerline,blindFS/powerline,prvnkumar/powerline,bartvm/powerline,lukw00/powerline,darac/powerline,Luffin/powerline,EricSB/powerline,S0lll0s/powerline,IvanAli/powerline,areteix/powerline,junix/powerline,DoctorJellyface/powerline,DoctorJellyface/powerline,seanfisk/powerline,wfscheper/powerline,QuLogic/powerline,cyrixhero/powerline,junix/powerline,xxxhycl2010/powerline,xfumihiro/powerline,magus424/powerline,s0undt3ch/powerline,kenrachynski/powerline,firebitsbr/powerline,keelerm84/powerline,bartvm/powerline,kenrachynski/powerline,lukw00/powerline,wfscheper/powerline,QuLogic/powerline,dragon788/powerline,xxxhycl2010/powerline,seanfisk/powerline,bartvm/powerline,russellb/powerline,wfscheper/powerline,dragon788/powerline,xfumihiro/powerline,russellb/powerline,s0undt3ch/powerline,russellb/powerline,S0lll0s/powerline,dragon788/powerline,prvnkumar/powerline,xxxhycl2010/powerline,Liangjianghao/powerline,cyrixhero/powerline,Liangjianghao/powerline,xfumihiro/powerline,S0lll0s/powerline,firebitsbr/powerline,IvanAli/powerline,blindFS/powerline,areteix/powerline,keelerm84/powerline,EricSB/powerline,kenrachynski/powerline,magus424/powerline,EricSB/powerline,darac/powerline,prvnkumar/powerline,blindFS/powerline,magus424/powerline,QuLogic/powerline,seanfisk/powerline,Luffin/powerline,IvanAli/powerline,cyrixhero/powerline,Luffin/powerline,firebitsbr/powerline,s0undt3ch/powerline,bezhermoso/powerline,DoctorJellyface/powerline,Liangjianghao/powerline,darac/powerline,lukw00/powerline