Fix deleted node handling in libprofile

In profile_find_node, skip deleted nodes when finding the second
match.  Otherwise, profile_clear_nodes could return an error if a node
has some values to clear but the last one is deleted.

In profile_node_iterator, skip deleted nodes when looking up the
section names.  Otherwise we could iterate over a deleted section
and/or ignore its replacement.

ticket: 7971 (new)
target_version: 1.12.2
tags: pullup
Fix creation/rename of top-level profile sections

profile_rename_section should demand only one name.

profile_add_relation should demand only one name if it is creating a
new section.  It aso needs to reset state before calling
profile_find_node for the section, in case it didn't look up any
parent sections previously.

ticket: 7972 (new)
target_version: 1.12.2
tags: pullup
Add profile tests for deletion bugs

Add three new libprofile tests to prof_test1, two to test for the bugs
in #7971 and one to test a bug which would have been introduced by a
candidate fix.
Add flag word to KDB iteration APIs
Support write locks in DB2 iteration

Add support to krb5_db_iterate() for requesting write locks in the DB2
back end.

In kdb5_util update_princ_encryption, instead of getting an outer
write lock on the KDB, use the iterflags parameter of
krb5_db_iterate() to request a write lock.
Support unlocked iteration in DB2

Add support to the DB2 KDB back end to optionally release the lock
when calling the iterator callback.  This prevents the blocking of
other processes when dumps of large databases are taking place.

Also add support for reversed iteration.
Support kdb5_util dump -rev again

Restore kdb5_util dump support for reversed dumps.