### Godot version

master CI builds

### System information

Linux / Editor with doubles and GCC sanitizers

### Issue description

The `Linux / Editor with doubles and GCC sanitizers` build can fail with a `attempting free on address which was not malloc()-ed` crash in the `Open and close editor (Vulkan)` step.

https://github.com/godotengine/godot/actions/runs/5366302204/jobs/9735786296#step:15:138
https://github.com/godotengine/godot/actions/runs/5389199469/jobs/9783070708?pr=78740#step:15:138

The failure doesn't seem related to either PR (in fact one of them is just a docs change). I have only seen this issue these two times, still probably worth looking into.

### Steps to reproduce

Open and close https://github.com/godotengine/regression-test-project/archive/4.0.zip using the Vulkan renderer.

### Minimal reproduction project

https://github.com/godotengine/regression-test-project/archive/4.0.zip
VkPipelineMultisampleStateCreateInfo multisample_state_create_info;
	multisample_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO;
	multisample_state_create_info.pNext = nullptr;
	multisample_state_create_info.flags = 0;
	multisample_state_create_info.rasterizationSamples = _ensure_supported_sample_count(p_multisample_state.sample_count);
	multisample_state_create_info.sampleShadingEnable = p_multisample_state.enable_sample_shading;
	multisample_state_create_info.minSampleShading = p_multisample_state.min_sample_shading;
	Vector<VkSampleMask> sample_mask;
	if (p_multisample_state.sample_mask.size()) {
		
		const int rasterization_sample_mask_expected_size[TEXTURE_SAMPLES_MAX] = {
			1, 2, 4, 8, 16, 32, 64
		};
		ERR_FAIL_COND_V(rasterization_sample_mask_expected_size[p_multisample_state.sample_count] != p_multisample_state.sample_mask.size(), RID());
		sample_mask.resize(p_multisample_state.sample_mask.size());
		for (int i = 0; i < p_multisample_state.sample_mask.size(); i++) {
			VkSampleMask mask = p_multisample_state.sample_mask[i];
			sample_mask.push_back(mask);
		}
		multisample_state_create_info.pSampleMask = sample_mask.ptr();
	} else {
		multisample_state_create_info.pSampleMask = nullptr;
	}
	multisample_state_create_info.alphaToCoverageEnable = p_multisample_state.enable_alpha_to_coverage;
	multisample_state_create_info.alphaToOneEnable = p_multisample_state.enable_alpha_to_one;
	
	VkPipelineDepthStencilStateCreateInfo depth_stencil_state_create_info;
	depth_stencil_state_create_info.sType = VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO;
	depth_stencil_state_create_info.pNext = nullptr;