Fix leaked logger in unit tests