Fix r_socket for mingw32