Large deviations for a stochastic model of heat flow