math/vec3: Rework cross() slightly

This change allows the destination vector to be the same instance as one
of the operands by storing the results of each calculation into a
temporary vector, and copying the result into the destination vector
afterwards.