writeLogArtifact
Write records to sink as an NDJSON artifact: one JSON LogRecord per line, newline-terminated, in order. One call per booted device produces one file.
Uses a kotlinx-io Sink so the same writer runs on every target — a file on the JVM/Android/Native, an in-memory buffer in a test. The sink is flushed before returning; closing it remains the caller's responsibility (the caller owns the file/connection lifecycle).