Fix dns_transmit bug by Matthew Dempsky

http://marc.info/?l=djbdns&m=119983220815170&w=3

dns_transmit implements a state-machine for sending and retrying DNS
queries over UDP and TCP. tcpstate == 2 indicates that the d->s1 - 1
is connected to a server and has sent d->pos bytes of the DNS query to
the server [see comments on lines 299–300 of dns_transmit.c].

The state-machine arrives at tcpstate == 2 one of two ways. connect(2)
can return -1/EINPROGRESS, and the state-machine will enter tcpstate
== 1, which will later transition to tcpstate == 2 if the connection
succeeds [lines 127–175,286–295]. Alternatively, connect(2) may
succeed immediately and the state-machine will transition directly to
tcpstate == 2 [lines 168–171].

When dns_transmit changes from tcpstate == 1 to tcpstate == 2, it will
reset d->pos to 0. However, it does not do this when connect(2)
succeeds immediately.

Signed-off-by: Giam Teck Choon <giamteckchoon@gmail.com>