Optimal control theory applied to fusion plasma thermal stabilization