Patch to fix errors thrown by socket_shutdown.