keyfile: rework selecting path name in nms_keyfile_writer_connection() and add...

keyfile: rework selecting path name in nms_keyfile_writer_connection() and add callback to reject filenames

The previous logic seems complicated to me. I even think it is wrong.
Rework it, I think this makes sense.

Also, previously the existing path was used if the file didn't exist.
I think that is wrong. If for force a rename, then the filename must
not be used even if the file currently does not exist.

Also add an "allow_filename_cb" argument, to reject filenames that
are blacklisted.
12 jobs for th/various-settings-cleanup-2 in 32 minutes and 58 seconds (queued for 1 second)
Status Job ID Name Coverage
  Test
passed #363511
allowed to fail
checkpatch

00:01:00

manual #363516
allowed to fail manual
t_centos:7.5.1804
passed #363517
t_centos:7.6.1810

00:23:02

passed #363520
t_debian:9

00:14:07

passed #363522
t_debian:sid

00:17:05

manual #363521
allowed to fail manual
t_debian:testing
passed #363512
t_fedora:28

00:18:31

passed #363513
t_fedora:29

00:32:57

passed #363514
t_fedora:30

00:26:28

manual #363515
allowed to fail manual
t_fedora:rawhide
passed #363518
t_ubuntu:16.04

00:14:31

passed #363519
t_ubuntu:18.04

00:14:40