Add check around plugin dlclose.