socket: Split up sosend_generic()
Factor out the bits that run with the sock I/O lock held into a separate
function. In this implementation, we are doing a bit more work under
the I/O lock than before. However, lock contention is only a problem
when multiple threads are transmitting on the same socket, which is an
unusual case that is not expected to perform well in any case.
No functional change intended.
Reviewed by: gallatin, glebius
MFC after: 2 weeks
Sponsored by: Klara, Inc.
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D46305
(cherry picked from commit fb901935f257ddcc492fe9efb605797f181c6597)