The exact solution of the Riemann problem with non-zero tangential velocities in relativistic hydrodynamics