This fixes sock_address_init_resolv() to properly parse the linked-list returned by getaddrinfo().

The previous implementation simply took the first entry, which could be an IPv6 address
instead of an IPv4 one in certain OS setups. This created problems when "localhost" resolved
to :::1 instead of 127.0.0.1. For example, when implementing inter-emulator telephony or SMS,
since the caller would try to connect to localhost:5556, which was resolved to :::1:5556 while
the received is listening on 127.0.0.1:5556

Also disable debugging traces that should not be activated. And make the error messages in
sockets.c only dumped to the terminal when -debug-socket is active.
diff --git a/telephony/sysdeps_qemu.c b/telephony/sysdeps_qemu.c
index ec0b3f5..a88f2fb 100644
--- a/telephony/sysdeps_qemu.c
+++ b/telephony/sysdeps_qemu.c
@@ -12,6 +12,7 @@
 #include "sockets.h"
 #include "sysdeps.h"
 #include "qemu-timer.h"
+#include "qemu-char.h"
 #ifdef _WIN32
 #include <winsock2.h>
 #else
@@ -23,7 +24,7 @@
 #include <netdb.h>
 #endif
 
-#define  DEBUG  1
+#define  DEBUG  0
 
 #define  D_ACTIVE  DEBUG