c_glib: use gethostbyname_r to get address info

avoid to seg fault in multi-thread environment.