Aberdeen became the third Scottish side to win a European trophy when they defeated Real Madrid 2-1 after extra time in the Cup Winners' Cup final in Gothenburg.