Ferrari's Charles Leclerc almost crashed into the barriers during a tricky final practice session for the Turkish Grand Prix.