Radiation tolerance of CVD diamond detectors for pions and protons