Coulomb-oscillator duality in spaces of constant curvature