How Pakistan’s army helped Khan win