How did John Adams successfully avoid a war with France during his term as President?