Engine thermal management with model predictive control