fix issue 153

Fix crash when closing socket on windows