Pulse-shape discrimination for a recoil-proton spectrometer based on a P-I-N photodiode