Wolfsburg beat Borussia Dortmund 3-1 to win the German Cup for the first time, denying Jurgen Klopp the perfect send-off in his final game as Dortmund coach.