bugfix for socket methods

1) check for exceptions raised by socket.shutdown
2) add MSG_WAITALL flag to socket.recv

code tested on GNU/Linux and OSX