fix(backend): fix data race in tests using captureDebugLogs
Christian Rocha
created
The captureDebugLogs function was using a plain bytes.Buffer which is
not safe for concurrent access. When app.New spawns goroutines that log
asynchronously (e.g., mcp.Initialize), the test would read from the
buffer while goroutines were still writing to it, causing a data race.
This change introduces a syncBuffer type that wraps bytes.Buffer with
a mutex, making it safe for concurrent reads and writes.