Attempt to recover from an UnknownHostException.  If getLocalHost()
throws an exception, attempt to provide the IP address instead.  This
is useful on those systems without a hostname explicitly defined.
Loop through all network interfaces to find an acceptable ip address.
Check for null prior to accessing inetAddress.
LOGBACK-749: combined pull requests from @valodzka and @timclemons

This should resolve LOGBACK-749.