I have added code to address this by checking the return value of krb_get_cred() in the initial attempt. If the response is NO_TKT_FIL then I abort the attempt to obtain AFS tokens via krb4. This avoids the call to krb_mk_req() which displays the kinit dialog