Networks of military alliances, wars, and international trade