PERL-323 add windows-specific socket close on error conditions