Better retry logic for network timeouts.