Run getaddrinfo()/gethostbyname() in separate thread to avoid blocking. Only one resolving thread is running at one time, so this should work also on systems where the functions are not thread-safe.
Introduce a new function with callback to resolve names to IP addresses asynchronously. For now, use a blocking wrapper around DNS_Name2IPAddress.