Stability analysis of stochastic swarm systems