Sri Lanka build lead in Pakistan Test