curl-functions.m4: update detection logic of getaddrinfo() thread-safeness