On complete reducibility for infinite-dimensional Lie algebras