net: ensure identical queries are not sent multiple times in builtin stub resolver

Prevents non-rooted queries with > ndots dots from being tried twice on error.
Fixes issue 8616.

Benchmark results on linux/amd64
benchmark                        old ns/op    new ns/op    delta
BenchmarkGoLookupIPNoSuchHost      8212394      4413293  -46.26%

benchmark                       old allocs   new allocs    delta
BenchmarkGoLookupIPNoSuchHost          216          108  -50.00%

benchmark                        old bytes    new bytes    delta
BenchmarkGoLookupIPNoSuchHost        17460         8726  -50.02%

LGTM=iant, mikioh.mikioh
R=golang-codereviews, iant, mikioh.mikioh
CC=golang-codereviews
https://codereview.appspot.com/137870043

Committer: Mikio Hara <mikioh.mikioh@gmail.com>
undo CL 107150043 / caa2646daa63

preparing for the syscall package freeze.
the change for issue 8218 is only applied to go.sys/unix.

««« original CL description
syscall: implement setresuid(2) and setresgid(2) on OpenBSD/FreeBSD/DragonflyBSD

Fixes issue 8218.

LGTM=iant
R=golang-codereviews, iant, minux
CC=golang-codereviews
https://codereview.appspot.com/107150043

Committer: Ian Lance Taylor <iant@golang.org>
»»»

LGTM=r
R=r, iant, golang-codereviews
CC=golang-codereviews
https://codereview.appspot.com/138840044