Repository: godot
Issue: Godot sometimes leaks memory  when executing `AudioStreamPlayer.set_stream`
Labels: bug,topic:audio

### Godot version

4.0.beta.custom_build. b809b6d97

### System information

Ubuntu 22.04 - Nvidia GTX 970, Gnome shell 42 X11

### Issue description

When executing
```
	var temp_variable1 = AudioStreamPlayer.new()
	add_child(temp_variable1)
	temp_variable1.set_stream(AudioStreamWAV.new())
	temp_variable1.is_playing()
	temp_variable1._set_playing(true)
	temp_variable1.queue_free()
```
Godot sometimes leaks this memory

```
Direct leak of 72 byte(s) in 1 object(s) allocated from:
    #0 0x7fe2533ad868 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:144
    #1 0x1c123199 in Memory::alloc_static(unsigned long, bool) (/usr/bin/godot4sy+0x1c123199)
    #2 0x264a401 in DefaultAllocator::alloc(unsigned long) (/usr/bin/godot4sy+0x264a401)
    #3 0x1c1230cd in operator new(unsigned long, void* (*)(unsigned long)) (/usr/bin/godot4sy+0x1c1230cd)
    #4 0x1804b64b in SafeList<AudioServer::AudioStreamPlaybackListNode*, DefaultAllocator>::insert(AudioServer::AudioStreamPlaybackListNode*) (/usr/bin/godot4sy+0x1804b64b)
    #5 0x1800fb68 in AudioServer::start_playback_stream(Ref<AudioStreamPlayback>, HashMap<StringName, Vector<AudioFrame>, HashMapHasherDefault, HashMapComparatorDefault<StringName>, DefaultTypedAllocator<HashMapElement<StringName, Vector<AudioFrame> > > >, float, float, float, float) (/usr/bin/godot4sy+0x1800fb68)
    #6 0x1800df0c in AudioServer::start_playback_stream(Ref<AudioStreamPlayback>, StringName, Vector<AudioFrame>, float, float) (/usr/bin/godot4sy+0x1800df0c)
    #7 0x15f1e03f in AudioStreamPlayer::play(float) (/usr/bin/godot4sy+0x15f1e03f)
    #8 0x15f21005 in AudioStreamPlayer::_set_playing(bool) (/usr/bin/godot4sy+0x15f21005)
    #9 0x40a7289 in void call_with_variant_args_helper<__UnexistingClass, bool, 0ul>(__UnexistingClass*, void (__UnexistingClass::*)(bool), Variant const**, Callable::CallError&, IndexSequence<0ul>) (/usr/bin/godot4sy+0x40a7289)
    #10 0x40a2d39 in void call_with_variant_args_dv<__UnexistingClass, bool>(__UnexistingClass*, void (__UnexistingClass::*)(bool), Variant const**, int, Callable::CallError&, Vector<Variant> const&) (/usr/bin/godot4sy+0x40a2d39)
    #11 0x409f1e8 in MethodBindT<bool>::call(Object*, Variant const**, int, Callable::CallError&) (/usr/bin/godot4sy+0x409f1e8)
    #12 0x1d7d9334 in Object::callp(StringName const&, Variant const**, int, Callable::CallError&) (/usr/bin/godot4sy+0x1d7d9334)
    #13 0x1cd93cdd in Variant::callp(StringName const&, Variant const**, int, Variant&, Callable::CallError&) (/usr/bin/godot4sy+0x1cd93cdd)
    #14 0x5d846b2 in GDScriptFunction::call(GDScriptInstance*, Variant const**, int, Callable::CallError&, GDScriptFunction::CallState*) (/usr/bin/godot4sy+0x5d846b2)
    #15 0x57bd7c5 in GDScriptInstance::callp(StringName const&, Variant const**, int, Callable::CallError&) (/usr/bin/godot4sy+0x57bd7c5)
    #16 0x12b53839 in bool Node::_gdvirtual__process_call<false>(double) (/usr/bin/godot4sy+0x12b53839)
    #17 0x12abe920 in Node::_notification(int) (/usr/bin/godot4sy+0x12abe920)
    #18 0x4568455 in Node::_notificationv(int, bool) (/usr/bin/godot4sy+0x4568455)
    #19 0x1d7da811 in Object::notification(int, bool) (/usr/bin/godot4sy+0x1d7da811)
    #20 0x12c13e76 in SceneTree::_notify_group_pause(StringName const&, int) (/usr/bin/godot4sy+0x12c13e76)
    #21 0x12c06b5d in SceneTree::process(double) (/usr/bin/godot4sy+0x12c06b5d)
    #22 0x283ff52 in Main::iteration() (/usr/bin/godot4sy+0x283ff52)
    #23 0x266707b in OS_LinuxBSD::run() (/usr/bin/godot4sy+0x266707b)
    #24 0x26453f3 in main (/usr/bin/godot4sy+0x26453f3)
    #25 0x7fe25275cd8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)
```


This example was found by Godot fuzzer - [Qarminer](https://github.com/qarmin/Qarminer), so it is quite unlikelly that this code could be used in real project, but still this should be handled gracefully.


### Steps to reproduce

Above

### Minimal reproduction project

_No response_