This is to ensure that dynamic declarations can actually change the
socket layout outside of operators that explicitly call
`update_node_declaration_and_sockets`.
This is necessary because link remapping uses the `socket_map`. If the
declaration removes sockets this `socket_map` becomes invalid. So
updating the declaration may only happen _after_ any references to
previous sockets are no longer needed.