fix a bug in gethostbyname function with GNULL parameter in mac os x and linux.