shutdown() socket instead of close()

Makes any blocking recv exit
Special return code for "socket closed"

Blocking recv calls return a special return code (-2) for notifying the socket
is closed (this information is useful for MDP socket users).

This implementation is unsatisfactory: return code should instead be consistent
with recvfrom(), that is always returning the length of received data (0 for
socket closed).