Diagrammatic expansion for positive spectral functions beyond GW: Application to vertex corrections in the electron gas