[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.
Looks good, but call this spark.shuffle.connection.retries. I also wonder, should we be sleeping more after each retry? We seem to be sleeping only 1 ms after each one.