### Godot version

4.1.stable

### System information

Windows 10 22H2 - GLES3 - GTX 1080 Ti (driver 536.40)

### Issue description

I noticed this bug in the code while debugging #79315, and confirmed the issue with testing. If you take a material using a filtering mode that has anisotropic filtering (eg `RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC` aka "Linear Mipmap Anisotropic") and switch it to a filtering mode that doesn't have anisotropic filtering (eg `RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS` aka "Linear Mipmap"), the anisotropic filtering remains enabled for the texture until it gets reloaded (eg by reloading the scene). I've only tested this in the editor, but this should also apply to games themselves if they change the filtering mode of a texture through code. This issue doesn't occur with the Mobile renderer (and I assume the Forward+ renderer).



### Steps to reproduce

1. View a surface with a material with anisotropic filtering disabled at an angle that you can tell it's disabled.
![no anisotropic](https://github.com/godotengine/godot/assets/607715/4c3f2c68-6284-412c-9adf-625f4c3e2ab6)

2. Switch the filtering mode of the material to one with anisotropic filtering enabled.
![with anisotropic](https://github.com/godotengine/godot/assets/607715/b67e5bb5-68f8-4934-bf0f-35836666724e)

3. Switch the filtering mode of the material back to a mode with anisotropic filtering disabled, and note how the surface still has anisotropic filtering applied.
![bug anisotropic](https://github.com/godotengine/godot/assets/607715/05037b2e-be9f-4351-8a77-b9b73c832696)


### Minimal reproduction project

I used the texture repeat test program from #79315 for the example pictures, so I'll use that as the minimum reproduction: [RepTest.zip](https://github.com/godotengine/godot/files/12011701/RepTest.zip). Just make sure to rotate the camera for the test, as the default position in that project isn't in a good spot for testing anisotropic filtering.
Texture *texture = texture_owner.get_or_null(p_rid);
		if (texture && texture->is_proxy) {
			return texture_owner.get_or_null(texture->proxy_to);
		}
		return texture;
	};
	bool owns_texture(RID p_rid) { return texture_owner.owns(p_rid); };
	virtual bool can_create_resources_async() const override;
	virtual RID texture_allocate() override;
	virtual void texture_free(RID p_rid) override;
	virtual void texture_2d_initialize(RID p_texture, const Ref<Image> &p_image) override;
	virtual void texture_2d_layered_initialize(RID p_texture, const Vector<Ref<Image>> &p_layers, RS::TextureLayeredType p_layered_type) override;
	virtual void texture_3d_initialize(RID p_texture, Image::Format, int p_width, int p_height, int p_depth, bool p_mipmaps, const Vector<Ref<Image>> &p_data) override;
	virtual void texture_proxy_initialize(RID p_texture, RID p_base) override; 
	RID texture_create_external(Texture::Type p_type, Image::Format p_format, unsigned int p_image, int p_width, int p_height, int p_depth, int p_layers, RS::TextureLayeredType p_layered_type = RS::TEXTURE_LAYERED_2D_ARRAY);
	virtual void texture_2d_update(RID p_texture, const Ref<Image> &p_image, int p_layer = 0) override;
	virtual void texture_3d_update(RID p_texture, const Vector<Ref<Image>> &p_data) override{};
	virtual void texture_proxy_update(RID p_proxy, RID p_base) override;
	
	virtual void texture_2d_placeholder_initialize(RID p_texture) override;
	virtual void texture_2d_layered_placeholder_initialize(RID p_texture, RenderingServer::TextureLayeredType p_layered_type) override;
	virtual void texture_3d_placeholder_initialize(RID p_texture) override;
	virtual Ref<Image> texture_2d_get(RID p_texture) const override;
	virtual Ref<Image> texture_2d_layer_get(RID p_texture, int p_layer) const override { return Ref<Image>(); };