Fixed crash of test_socket test on Windows