### Godot version

4.0.beta

### System information

Windows 10

### Issue description

As revealed by the video of "Gamefromscratch" about using Haxe in godot 4, the import of an invalid "wavefront" obj file may drain the system memory.
Godot 4.0 reports an error for every line of the imported file, and when you switch between 2 apps (e.g. Godot & Program manager), the import process is run again, making Godot taking more memory every time.
I also noticed that after cleaning the output panel, the memory is still a little bit higher than before the import (this may be a problem with the output panel).
![TestOBJImport-Beta13](https://user-images.githubusercontent.com/12656483/213326612-27ca17db-7d96-416c-8a25-ac5a1ad75965.png)

As "wavefront" files are text-formatted ones, it may be possible to have some kind of check while importing and avoid all these errors.

"3.5.1-stable" doesn't really have this problem and I think it's because the import isn't run every time Godot gets the focus
![TestOBJImport-3 5 1](https://user-images.githubusercontent.com/12656483/213326569-8426f49e-2fec-43e7-ba30-3d89f8a16608.png)


### Steps to reproduce

Import the MRP and switch between Godot and another app

### Minimal reproduction project

[TestOBJImport.zip](https://github.com/godotengine/godot/files/10452270/TestOBJImport.zip)

List<Ref<Mesh>> meshes;
	Error err = _parse_obj(p_path, meshes, false, p_flags & IMPORT_GENERATE_TANGENT_ARRAYS, false, Vector3(1, 1, 1), Vector3(0, 0, 0), r_missing_deps);
	if (err != OK) {
		if (r_err) {
			*r_err = err;
		}
		return nullptr;
	}
	Node3D *scene = memnew(Node3D);
	for (const Ref<Mesh> &m : meshes) {
		Ref<ImporterMesh> mesh;
		mesh.instantiate();
		mesh->set_name(m->get_name());
		for (int i = 0; i < m->get_surface_count(); i++) {
			mesh->add_surface(m->surface_get_primitive_type(i), m->surface_get_arrays(i), Array(), Dictionary(), m->surface_get_material(i));
		}
		ImporterMeshInstance3D *mi = memnew(ImporterMeshInstance3D);
		mi->set_mesh(mesh);
		mi->set_name(m->get_name());
		scene->add_child(mi, true);
		mi->set_owner(scene);
	}
	if (r_err) {
		*r_err = OK;
	}
	return scene;
}
void EditorOBJImporter::get_extensions(List<String> *r_extensions) const {