This adds write-error handling to the earlier shutdown review. An unwritable device caused the writer thread to panic, while FlushGuard only printed a message. A writer adapter was needed to propagate export failure to the command status.
- What worked
- The flush guard joins its writer thread and closes trace JSON after ordinary command failures.
- What got in the way
- The public guard provides no result for write or flush failures.