Despite its long alienation from the world, Pakistan has emerged as an essential mediator in negotiation efforts between the United States and Iran—suddenly a major international player.