exchange: fix locking to actually be scoped...
exchange: fix locking to actually be scoped
The previous code was taking locks before entering with statements, so
exception before the with statement would not release the lock (except for
garbage collection).