The new strategic partnership agreement opens the door to closer diplomatic, economic and technological cooperation with former foe — and China’s neighbor — Hanoi.