net.c: Fix idle disconnect in SYN state

This should prevent idle file transfers from getting stalled
indefinitely.
net.c: Fix error reporting in SYN state with TLS enabled