Add concurrent.Lock#doWith to wrap acquire/release logic

A method I have used on a few occasions to eliminate the boilerplate acquire/release when executing simple statements in a locked environment.

Review by @phaller please!