Minimize time in lock during Dispose() to reduce contention

This change minimizes the time in the SocketPool lock to only when making changes (avoiding the time in Sleep())