A Real-Time Optimal Control Approach To Autonomous Drifting