Atletico Madrid's Julian Alvarez had a penalty dramatically ruled out in the shootout as Real Madrid edged out their city rivals to reach the quarter-finals.