Vertex correction to RPA and superconductivity in the two-dimensional Hubbard model