Null-pointer check in add_admin_princ

If allocating memory for principal@realm fails, NULL pointer is
passed as name to libkrb5:krb5_parse_name, eventually leading to
null-pointer dereference in allocate_princ.

Also replacing private function build_name_with_realm with direct
call to asprintf.