Revert "remove scope of locking when putting sessions back into pool"

This reverts commit a0e10fe111f69881da9fc153a722bcced9ef79d1.
Merge remote-tracking branch 'upstream/master'