relay: make thread mutable to fix reconnection