Characterization of the cooling process of solid n-alkanes via terahertz spectroscopy