Try to relog if needed when connectivity reappears

Part of work on #2025.