Do not acquire sockets with iter.m locked.

This prevents the deadlock reported by John Morales in MGO-57.