On the vanishing of self extensions over algebras