Ignore case when checking for "socket closed" exception.
Windows and UNIX use different cases for this message.