Set result to SERVFAIL if upstream responded with FORMERR

Commit ba912435 causes the resolver to
respond to a client query with FORMERR when all upstream queries sent to
the servers authoritative for QNAME elicit FORMERR responses.  This
happens because resolver code returns DNS_R_FORMERR in such a case and
dns_result_torcode() acts as a pass-through for all arguments which are
already a valid RCODE.

The correct RCODE to set in the response returned to the client in the
case described above is SERVFAIL.  Make sure this happens by overriding
the RCODE in query_gotanswer(), on the grounds that any format errors in
the client query itself should be caught long before execution reaches
that point.  This change should not reduce query error logging accuracy
as the resolver code itself reports the exact reason for returning a
DNS_R_FORMERR result using log_formerr().
27 jobs for wpk-servfail-on-upstream-formerr in 7 minutes and 57 seconds (queued for 6 seconds)
Status Job ID Name Coverage
  Precheck
passed #71887
amd64 docker linux
precheck:debian:sid:amd64

00:00:17

 
  Build
passed #71888
amd64 docker linux
build:centos:centos6:amd64

00:02:15

passed #71889
amd64 docker linux
build:centos:centos7:amd64

00:02:35

passed #71890
amd64 docker linux
build:clang:debian:stretch:amd64

00:01:48

passed #71894
i386 docker linux
build:clang:debian:stretch:i386

00:02:08

passed #71891
amd64 docker linux
build:debian:jessie:amd64

00:01:20

passed #71893
amd64 docker linux
build:debian:sid:amd64

00:01:43

passed #71895
i386 docker linux
build:debian:sid:i386

00:01:50

passed #71892
amd64 docker linux
build:debian:stretch:amd64

00:01:33

passed #71896
amd64 docker linux
pkcs11:build:debian:sid:amd64

00:01:42

 
  Test
passed #71897
amd64 docker linux
docs:debian:sid:amd64

00:00:51

passed #71911
amd64 docker linux
install:debian:sid:amd64

00:02:03

passed #71913
amd64 docker linux
pkcs11:systemtest:debian:sid:amd64

00:04:37

passed #71912
amd64 docker linux
pkcs11:unittest:debian:sid:amd64

00:00:53

passed #71905
amd64 docker linux
systemtest:centos:centos6:amd64

00:04:45

passed #71906
amd64 docker linux
systemtest:centos:centos7:amd64

00:04:38

passed #71907
amd64 docker linux
systemtest:debian:jessie:amd64

00:04:51

passed #71909
amd64 docker linux
systemtest:debian:sid:amd64

00:04:38

passed #71910
i386 docker linux
systemtest:debian:sid:i386

00:05:01

passed #71908
amd64 docker linux
systemtest:debian:stretch:amd64

00:04:52

passed #71898
amd64 docker linux
unittest:centos:centos6:amd64

00:00:45

passed #71899
amd64 docker linux
unittest:centos:centos7:amd64

00:01:01

passed #71903
amd64 docker linux
unittest:clang:debian:stretch:amd64

00:00:52

passed #71900
amd64 docker linux
unittest:debian:jessie:amd64

00:00:55

passed #71902
amd64 docker linux
unittest:debian:sid:amd64

00:00:51

passed #71904
i386 docker linux
unittest:debian:sid:i386

00:00:50

passed #71901
amd64 docker linux
unittest:debian:stretch:amd64

00:00:56