Pakistan beat Sri Lanka in third one-dayer