[trac678] refactor the stop interface for udp and tcp server and related unittest to dns_server_unitttest