Fixed buffer leaks in LoggingHandlerTest