Ab initio potential energy curves for the CO+ ion and a study of the photoelectron spectra of CO