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

StringName get_tip_bone() const;
	void set_interpolation(real_t p_interpolation);
	real_t get_interpolation() const;
	void set_target_transform(const Transform3D &p_target);
	const Transform3D &get_target_transform() const;
	void set_target_node(const NodePath &p_node);
	NodePath get_target_node();
	void set_override_tip_basis(bool p_override);
	bool is_override_tip_basis() const;
	void set_use_magnet(bool p_use);
	bool is_using_magnet() const;
	void set_magnet_position(const Vector3 &p_local_position);
	const Vector3 &get_magnet_position() const;
	void set_min_distance(real_t p_min_distance);
	real_t get_min_distance() const { return min_distance; }
	void set_max_iterations(int p_iterations);
	int get_max_iterations() const { return max_iterations; }
	Skeleton3D *get_parent_skeleton() const { return skeleton; }
	bool is_running();
	void start(bool p_one_time = false);
	void stop();
private:
	Transform3D _get_target_transform();
	void reload_chain();
	void reload_goal();
	void _solve_chain();
};
#endif 
#endif