network: don't remove an entire socket instance from an endpoint when decreasing its refcount, unless the refcount goes to zero.