[SPARK-2563] Make connection retries configurable

In a large EC2 cluster, I often see the first shuffle stage in a job fail due to connection timeout exceptions. This patch makes the number of connection retries configurable to handle these cases.