Add missing lock around the use of gethostbyaddr.

This cures the symptoms of ROOT-6828 ... however this will fails if any other code anywhere else also
uses gethostbyaddr .. the right solution is to replace the use of gethostbyaddr by getaddrinfo