The websocket producer kept a single connection per instance in
`clients map[string]*websocket.Conn`. Registering a second subscriber
silently replaced the first, and `RemoveClient` deleted the whole instance
entry when either one disconnected. Consuming events in two browser tabs
therefore delivered to only the most recent one, and closing that tab cut
delivery for the remaining subscriber too.
Changes:
- `clients` becomes `map[string][]*client`. Deregistration now matches the
specific connection instead of removing the instance entry, so sibling
subscribers keep receiving events.
- Each connection carries its own write mutex. Events are dispatched from
independent goroutines (the `go CallWebhook` calls in the whatsmeow event
handler) and gorilla/websocket permits only one concurrent writer per
connection, so two simultaneous events could interleave writes on the
same socket.
- `Produce` snapshots the subscriber list under the read lock and performs
writes outside it, so a slow or half-open socket no longer blocks
deliveries for other instances.
- Failed writes prune the dead connection, and `Produce` now returns nil.
`sendToQueueOrWebhook` aborts the remaining producers when one returns an
error, so a closed browser tab previously suppressed RabbitMQ, NATS and
webhook delivery for that same event.
Verified with two concurrent subscribers on one instance: both receive
identical event streams, and disconnecting one leaves the other unaffected.
(cherry picked from commit 1db4408244fe75b39c2b4e1bbb8e681679dd7dae)