Optimization of the synthesis of a key intermediate for the preparation of glucocorticoids