net/dns: Add fmt_dns_domain function
selftests: Flush output in NL(), and dump program's output when it dies