### 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)

};
private:
	
	static bool build_chain(Task *p_task, bool p_force_simple_chain = true);
	static void solve_simple(Task *p_task, bool p_solve_magnet, Vector3 p_origin_pos);
	
	static void solve_simple_backwards(const Chain &r_chain, bool p_solve_magnet);
	static void solve_simple_forwards(Chain &r_chain, bool p_solve_magnet, Vector3 p_origin_pos);
public:
	static Task *create_simple_task(Skeleton3D *p_sk, BoneId root_bone, BoneId tip_bone, const Transform3D &goal_transform);
	static void free_task(Task *p_task);
	
	static void set_goal(Task *p_task, const Transform3D &p_goal);
	static void make_goal(Task *p_task, const Transform3D &p_inverse_transf, real_t blending_delta);
	static void solve(Task *p_task, real_t blending_delta, bool override_tip_basis, bool p_use_magnet, const Vector3 &p_magnet_position);
	static void _update_chain(const Skeleton3D *p_skeleton, ChainItem *p_chain_item);
};
class SkeletonIK3D : public Node {