### Godot version

4.1dev 4c677c88

### System information

Windows 10

### Issue description

A use-after-free situation exists in SkeletonIK3D because it holds hard references to both SkeletonIK3D and the target node Node3D.



### Steps to reproduce

1. Open the attached reference project.
2. It should already have a scene named `vrm_1_constraint_twist_sample.tscn` open. If not, open that specific scene.
3. Select the SkeletonIK3D node and click Play IK in the toolbar (this step is usually not necessary)
4. Middle click the scene tab or close the scene tab another way.
5. It crashes because bones._cowdata._ptr[172] and higher (up to [400]) have corrupt data on my system. This type of memory corruption is often caused by use-after-free.

That said, due to the nature of memory allocations and undefined behavior, this problem may be uniquely reproducible on my system.

### Minimal reproduction project

[crash_when_closing_tab.zip](https://github.com/godotengine/godot/files/11561795/crash_when_closing_tab.zip)

solve_simple(p_task, false, origin_pos);
	
	ChainItem *ci(&p_task->chain.chain_root);
	while (ci) {
		Transform3D new_bone_pose(ci->initial_transform);
		new_bone_pose.origin = ci->current_pos;
		if (!ci->children.is_empty()) {
			Vector3 forward_vector = (ci->children[0].initial_transform.origin - ci->initial_transform.origin).normalized();
			
			new_bone_pose.basis.rotate_to_align(forward_vector, new_bone_pose.origin.direction_to(ci->children[0].current_pos));
		} else {
			
			if (override_tip_basis) {
				new_bone_pose.basis = p_task->chain.tips[0].end_effector->goal_transform.basis;
			} else {
				new_bone_pose.basis = new_bone_pose.basis * p_task->chain.tips[0].end_effector->goal_transform.basis;
			}
		}
		
		new_bone_pose.basis.orthonormalize();
		new_bone_pose.basis.scale(p_task->skeleton->get_bone_global_pose(ci->bone).basis.get_scale());
		p_task->skeleton->set_bone_global_pose_override(ci->bone, new_bone_pose, 1.0, true);
		if (!ci->children.is_empty()) {
			ci = &ci->children.write[0];
		} else {
			ci = nullptr;
		}
	}
}
void FabrikInverseKinematic::_update_chain(const Skeleton3D *p_sk, ChainItem *p_chain_item) {