[Core] Fix crash on shutdown related to unloading SD2 library