unloadUnreferencedMaterials: Properly unload materials instead of removing techniques