Optimization of the Thermal Tensioning Process for Minimum Residual Stress and Distortion