Guided-ion beam investigations of the reactions CO+ + N-2 and N-2(+) + CO