Yorkshire managed to reach T20 Blast Finals Day despite Surrey needing just 5 off the last over to win the quarter-final.