Stabilization of the wave equation with boundary or internal distributed delay