s3:libads: improve the logic in get_kdc_ip_string()