Gauge invariance of the color-superconducting gap on the mass shell