Nonlinear stability of self-similar solutions for semilinear wave equations