Self-regulated black hole accretion, the M−σ relation and the growth of bulges in galaxies