### 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
case VkPhysicalDeviceType::VK_PHYSICAL_DEVICE_TYPE_CPU: {
						if (type_selected < 1) {
							type_selected = 1;
							device_index = i;
						}
					} break;
					default: {
						if (type_selected < 0) {
							type_selected = 0;
							device_index = i;
						}
					} break;
				}
			}
		}
		int32_t user_device_index = Engine::get_singleton()->get_gpu_index(); 
		if (user_device_index >= 0 && user_device_index < (int32_t)gpu_count) {
			device_index = user_device_index;
		}
		ERR_FAIL_COND_V_MSG(device_index == -1, ERR_CANT_CREATE, "None of Vulkan devices supports both graphics and present queues.");
		gpu = physical_devices[device_index];
	}
	free(physical_devices);
	
	vkGetPhysicalDeviceProperties(gpu, &gpu_props);
	device_name = gpu_props.deviceName;
	device_type = gpu_props.deviceType;
	pipeline_cache_id = String::hex_encode_buffer(gpu_props.pipelineCacheUUID, VK_UUID_SIZE);
	pipeline_cache_id += "-driver-" + itos(gpu_props.driverVersion);
	{