Total energy decay for semilinear wave equations with a critical potential type of damping