Analysis of the rational Krylov subspace and ADI methods for solving the Lyapunov equation