agent: avoid deadlock in log streaming