simplify: Optimize and clean up triangle filtering
simplify: Optimize and clean up triangle filtering

Instead of storing triangles in the hash set redundantly, we now store
triangle indices; we optimistically write the triangle to the output
buffer and then perform the hash lookup; if the triangle is a duplicate,
we'll ignore the write.

This makes the code shorter and reduces simplification time for large
outputs up to 15%.

zeux/meshoptimizer,zeux/meshoptimizer,zeux/meshoptimizer