gpg,gpgsm: Tweak the locking of the pubring.kbx
* g10/keydb.c (keydb_search): Run the search also in locked state. (keydb_release): Unlock after close. * sm/keydb.c (keydb_add_resource): Ditto. (keydb_release): Ditto.
On Windows we need to make sure that we never access the pubring.kbx
without holding our advisory file lock. And that lock also needs to
be released after the close.