kbx,gpg,gpgsm: Introduce keybox_compress_when_no_other_users.
* kbx/keybox.h (keybox_compress_when_no_other_users): Rename from keybox_compress, changing the arguments and the return type. * kbx/keybox-update.c (keybox_compress_when_no_other_users): Open the HD internally and make sure all resources are closed before unlocking. * g10/keydb.c (keydb_add_resource): Simply call keybox_compress_when_no_other_users which handles locking internally. * sm/keydb.c (keydb_add_resource): Likewise.
- GnuPG-bug-id: T7855
- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>