[tools] testbot/LogUtils: Share code between _SaveLogErrors() and _DumpErrors().