Fix a logic error when creating an IPv6 socket

socket() returns a non-zero positive integer when successful