Stability and differential privacy of stochastic gradient methods