Energy-spread compensation in a solenoid-based secondary radioactive beam apparatus