BCJ relations from a new symmetry of gauge-theory amplitudes