Non-isothermal free energies for linear theories with memory