Move global config struct out of main()'s stack frame.
Make reconnection attempt parameters configurable.

New config settings:
  reconnect-max-tries: integer
  reconnect-max-interval: real (seconds)