Linear stability of a self-gravitating ring