Collective-defense pacts are meant to make war less likely. Poorly designed ones can do the opposite.