The temperature dependence of the width of the giant-dipole resonance