entwine: gate AddConn on shutdown like Go

main

Commit

Andrea Nodari5mo ago

Cursor Bugbot flagged that AddConn was not gated the way Go is: Shutdown snapshots the connection list when it begins, but AddConn kept appending afterward, so a connection registered after shutdown started (including during the join window) was omitted from the snapshot and never drained.

Gate AddConn on the same closed flag and lock used by Shutdown's snapshot, so a connection is either included in the drain set or explicitly refused and logged — never silently dropped. Add a regression test.