socket: Fix handling of listening sockets in sotoxsocket()
A lock needs to be held to ensure that the socket does not become a
listening socket while sotoxsocket() is loading fields from the socket
buffers, as the memory backing the socket buffers is repurposed when
transitioning to a listening socket.
MFC after: 1 week
Sponsored by: Klara, Inc.
Sponsored by: Stormshield