Pakistan overcome Sri Lanka in Hyderabad thriller