In preparation for moving sockbuf locks into the containing socket,
provide macros for the sockbuf I/O locks: SOCK_IO_SEND_(UN)LOCK() and
SOCK_IO_RECV_(UN)LOCK(). These locks are only used to prevent
concurrent readers and writters from interleaving I/O, so the new names
are more descriptive.
When locking for I/O, return an error if the socket is a listening
socket. Currently the check is racy since the sockbuf sx locks are
destroyed during the transition to a listening socket, but that will no
longer be true after some follow-up changes.
Modify a few places to check for errors from
sblock()/SOCK_IO_(SEND|RECV)_LOCK() where they were not before. In
particular, add checks to sendfile() and sorflush().