[SPARK-3736] Moving reconnection logic to registerWithMaster().

The logic of the worker reconnecting to the master is now shared with
the logic of attempting to connect to the master on the worker's
startup. Connection is attempted in certain intervals of time.

- The first six attempts are in 5 to 15 second intervals, and
- The ten attempts after that are in 30 to 90 second intervals.

The exact intervals between attempts are randomized in that range, in
order to introduce some jitter and prevent the master from being hit
with giant bursts of registration requests. This model is the same as
Hadoop's reconnection model.