Allow input_cred to be None in add_cred_impersonate_name()

This borrows the logic from the add_cred() function.