Fix getaddrinfo() loop
Fix getaddrinfo() loop

Commit b116d10f did the following change:
    Use switch, int and sa_family_t with AF_INET in uri.c.

This breaks when getaddrinfo() only returns a single record, as in that
case the "break" only exits the switch statement and the loop-step
"res=res->ai_next" is still executed. After that "res == NULL" is
wrongly interpreted as not having found an AF_INET or AF_INET6 address.

Signed-off-by: Marcelo Roberto Jimenez <cbfee7cc2b5ad5adb7c008f3609da41bdbf85ffa@users.sourceforge.net>
(cherry picked from commit faaef39a3c559cc0ffc60191c7b9b5179b5ab9a3)

commshare/pupnp,mrjimenez/pupnp,mrjimenez/pupnp,commshare/pupnp,mrjimenez/pupnp,commshare/pupnp,mrjimenez/pupnp