Heegaard stability in amalgamated 3-manifolds I: connected sums