We decided to start using RTLD_NODELETE when loading plugin modules, mostly for OpenSSL-related reasons. I think that should fix this problem; I would be interested in test results. Of course, this change also makes it even more pointless to dlclose() GSS modules from the libgssapi_krb5 finalizer. But we need to at least free the struct plugin_file_handle to avoid a memory leak on repeated loading and unloading of libgssapi_krb5, and there is also Windows to consider.