Kelvin–Helmholtz instability in self-gravitating streams