Fix bug #2709: TCP connect returns Invalid argument.