atexit handlers are impossible to remove on most platforms (except AIX
for some reason), and isn't symmetrical with when we initialize things.
Since we initialize things with a constructor, we should be using a
destructor instead of registering an atexit handler.
While applications shouldn't dlclose libgpg-error, they might do it
unintentionally, and this should be handled to avoid surprises when our
atexit handler disappears into the void.
In particular at least, this causes problems with applications that
dlclose things that depend on liggpg-error. For instance, PHP will
dlclose extensions, and if any depend on libgpg-error, these will also
get closed as part of removing unused dependents.
T1749 tried to deal with this by not using atexit, but this had the
effect of not doing deinit work. This moves deinit work into the dtor,
and sets up gpgrt for the concept of destructors anyways.