A new method for compensation and rematch of cavity failure in the C-ADS linac