fix(device): ensure broken connections are not reused
When we have a persistent connection, retries were not resetting the
connection until reaching the backoff limit. Close the connection immediately,
as a connection that is giving errors is of no use, and it is better to
retry using a new connection.
Possibly related to #4884 and/or #4885. Although these issues have gotten worse
since 2026.4.0 which reduced the heartbeat rate, keeping one-way receives in
between, the logs are showing the issues happen on the heartbeats, so it is not
clear that the lack of heartbeat is causing the issue.