Replace spaces and invalid characters in file names of exported keys
This unifies the removal/replacement of invalid characters (which was
done very inconsistently) and adds the replacement of space characters
in the file names used/proposed for exported keys. And it makes use of
the new Formatting::prettyNameOrEMail function to remove many instances
of duplicate code.
(cherry picked from commit 3c379f4e98e11ab2c885a4d1fd640601fdcba426)
- GnuPG-bug-id: T7848