Constraints from the cosmic microwave background on spacetime noncommutativity and causality violation