Sri Lanka ends a 14-year drought by beating Pakistan in a Twenty20 game at home to draw their three-match series 1-1.