Make sure we don't call inet_ntop w/ NULL arguments

The Linux version of inet_ntop does not like that and
this fact leads to a segfault.
dns: finally I got the overflow check right

* Added `start_from` parameter starting from zero by default; this
  parameter allows to speed up the checks of the unit test.

* Rewrote the code to break from the loop when the value becomes
  greater than INT_MAX, rather than SHRT_MAX; I switched to SHRT_MAX
  for testing convenience, but INT_MAX is the right thing to do.

* Rewrote the test: now we iterate in a small set around the last
  good value and we check that the behavior is correct.
dns: avoid check on every loop iteration
test/net/dns.cpp: test overflow check for zero records case

While there, also correct a couple of comments.