Clean up locking in BaseTransaction