Characterization of a silicon detector and front-end electronics prototype for single ion discrimination in hadrontherapy