Unlock locks when needed, instead of in defer

* Eliminate defer overhead to improve benchmarks