Stability of semiclassical bound states of nonlinear Schrödinger equations with potentials