Self-calibration of photometric redshift scatter in weak-lensing surveys