Update riack_sock.c

Fixed issue with socket not connecting properly in certain scenarios.