Predictive control of thermally induced wavefront aberrations