### 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
VkBufferMemoryBarrier buffer_mem_barrier;
	buffer_mem_barrier.sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER;
	buffer_mem_barrier.pNext = nullptr;
	buffer_mem_barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
	buffer_mem_barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
	buffer_mem_barrier.srcAccessMask = p_src_access;
	buffer_mem_barrier.dstAccessMask = p_dst_access;
	buffer_mem_barrier.buffer = buffer;
	buffer_mem_barrier.offset = p_from;
	buffer_mem_barrier.size = p_size;
	vkCmdPipelineBarrier(p_sync_with_draw ? frames[frame].draw_command_buffer : frames[frame].setup_command_buffer, p_src_stage_mask, p_dst_stage_mask, 0, 0, nullptr, 1, &buffer_mem_barrier, 0, nullptr);
}
RID RenderingDeviceVulkan::texture_create(const TextureFormat &p_format, const TextureView &p_view, const Vector<Vector<uint8_t>> &p_data) {
	_THREAD_SAFE_METHOD_
	VkImageCreateInfo image_create_info;
	image_create_info.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO;
	image_create_info.pNext = nullptr;
	image_create_info.flags = 0;
	VkImageFormatListCreateInfoKHR format_list_create_info; 
	Vector<VkFormat> allowed_formats; 
	if (p_format.shareable_formats.size()) {
		image_create_info.flags |= VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
		if (context->is_device_extension_enabled(VK_KHR_IMAGE_FORMAT_LIST_EXTENSION_NAME)) {
			for (int i = 0; i < p_format.shareable_formats.size(); i++) {
				allowed_formats.push_back(vulkan_formats[p_format.shareable_formats[i]]);
			}
			format_list_create_info.sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR;
			format_list_create_info.pNext = nullptr;
			format_list_create_info.viewFormatCount = allowed_formats.size();
			format_list_create_info.pViewFormats = allowed_formats.ptr();