## Description
Problem: opts.icon can be a table {icon, icon_hl} but the code inserts
opts.icon directly into filekey and later does table.concat(filekey,
"|"). That crashes when an element is a table.
Fix: use the first element of opts.icon when opts.icon is a table
(fallback to opts.icon or "").
## Related Issue(s)
N/A
## Screenshots
This happens when scratch.opts.icon is a table per documentation
<img width="1453" height="159" alt="image"
src="https://github.com/user-attachments/assets/c22cf58e-517d-400d-87d4-d05830df530d"
/>
## Description
When toggling scratch closed, it's possible for the active buffer to be
something other than the scratch buffer.
This results in the autowrite behaviour triggering a `write` for
whatever that active buffer was and leaving the scratch buffer as dirty.
## Related Issue(s)
- Fixes#449.