Adds destructors to LibraryHooks in order to avoid reuse of old callbacks.