Antonio Rudiger's late goal deep into extra-time saw Real Madrid shake off a spirited challenge by Real Sociedad and reach the Copa del Rey final.