exit dns threads with pthread_exit