Clarify realm and dbmodules configuration docs

In kdc_conf.rst, add examples showing how to configure a realm
parameter and a database parameter.  Document that the default DB
configuration section is the realm name, and use that in the example.
Move the db_module_dir description to the end of the [dbmodules]
documentation since it is rarely used and could confuse a reader about
the usual structure of the section.

(cherry picked from commit 689d769c10c53bd4fa40e82421c89b96cc86cbae)

ticket: 7762 (new)
version_fixed: 1.11.5
status: resolved
Fix use-before-init in two test programs

If krb5_init_context fails, use a null context for getting the error
message, not a context we haven't yet initialized.  Observed by David
Benjamin <davidben@mit.edu> using clang.

(cherry picked from commit 525eafc83a0fbe8f215b7749b5774d54468a19d1)

ticket: 7760
version_fixed: 1.11.5
status: resolved