Remove spurious locks, improve handling of wlock
- kwcommitctx is inside the wlock of repo.commit: no lock
- _kwfwrite only needs wlock
wlock outside try block, so we don't need to import lock.release
_kwfwrite should even be safer that way, as we moved the status
call inside the try-except block.
Thanks to Benoit Boissinot for help.