When fix_lib_overrides() writes to any mod[sid] on a GeoNode modifier,
Blender can re-evaluate ALL library overrides on that modifier, wiping
Material and Object sockets back to their library defaults (NONE).
Fix: snapshot all fragile sockets (NodeSocketMaterial, NodeSocketObject)
before any modifications, then restore them if they got wiped.