Network backend: Use getaddrinfo instead of gethostbyname

This has multiple benefits:
- gethostbyname is not thread-safe, and its thread-safe variant is
  a GNU extension. getaddrinfo on the other hand is thread-safe.
- gethostbyname has been removed in POSIX 2008.09, and was already
  deprecated in POSIX 2001.01.
- By using getaddrinfo, the network backend should now be able to
  connect to IPv6 addresses (untested).

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
Force compatibility to ANSI C and POSIX 2008.09

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>