fixed minor race condition in Socket.Dispose methods