In keydb.c:lock_all, gpg locks all of the keyrings / keyboxes in the order that
they are added. This can result in deadlock if multiple gpg processes add the
keyrings / keyboxes in different orders.
The solution to this is straightforward: take the locks according to some
standard ordering (e.g., lexicographical).