Slave: Rework master reconnection logic to be more resilient