The socket may get released if the sock_poll_event() is inspired by closing socket.
Here is a WIP test (where I am trying to test unrelated things) which causes assert in wineserver on closing socket (when server is trying to use already freed socket): https://gist.github.com/gofman/cc78a07ed58f6d02ff863388d5992acb