Update jnxnetwork.c

Made quite a few changes to socket closing on error throughout the file, will need to wrap tests around