[BUG] Healthchecks: get a proper error code if connection cannot be completed immediately

In case of a non-blocking socket, used for connecting to a remote
server (not localhost), the error reported by the health check
was most of a time one of EINPROGRESS/EAGAIN/EALREADY.

This patch adds a getsockopt(..., SO_ERROR, ...) call so now
the proper error message is reported.
1 file changed