Lyapunov stability of lossy energy networks