Planck 2013 results. X. HFI energetic particle effects: characterization, removal, and simulation