More robust nameserver thread in testing.

Signed-off-by: Martin Raspaud <martin.raspaud@smhi.se>