In T93455, the set material node added a new material index to mesh
primitives created in the node tree, since it did not find the material
it assigned in the material list. It would be better to reuse the first
empty material slot when possible, for a few reasons:
- The default material index will use the material, which is useful for modifiers like remesh that don't interpolate attributes.
- We could potentially avoid storing material indices if they were all zero and we stored them outside of MPoly in the future.
- It's expected intuitive behavior anyway.