Fix watchdog, fix overlay state, cleanup.

There was a watchdog that attempted to reset the state and disable the overlay, but
that 'watchdog' timer was never 'woken' and thus every minute the watchdog would bark!
This has been fixed, and the actions taken are also improved.

If you have a chartplotter =and= OpenCPN, and the plotter has already activated the radar
then OpenCPN will start drawing the radar image immediately when it is started, there is no
need to press the "radar" button. If you don't want overlay, you can always disable the plugin.

Some general cleanup.
Do not draw radar data if not in master mode in modes other than overlay.
Initialize settings and dialog properly

If one adds new settings or dialog items, make sure that they are initialized
with a sensible default instead of random data from the stack.
Fix 4G radar range

A new approach was used to determine the 4G radar ranges. As one of our testers reported,
the Navico chartplotters do not increase range when you scroll the chart image. That suddenly
showed me a way to measure what the actual range of the radar data is that is reported: set up
radar and chart side by side, set the radar image to a particular range and then zoom in on the
border of the radar image to see how far away that is.

It was kind of surprising to see that the returned data stream is, on most ranges, up to 100%
further away than the desired range... At first I did not want to believe this, but it is really
true! Just use the above procedure to corroborate.

Once this was done it was a lot easier to fill a spreadsheet and find out what the most likely
correction factor is. Instead of it using a correction factor like sqrt(2) it turned out to be
simple and elegant. As we already know, there are two 16 bit range values, with only
one of them being set at a time. It turns out that the bigger one of the two is exactly
8 bits bigger, i.e. there is a factor of 256 between the big and small ranges.

The overall range turns out to be a very good fit for the value 4, which also means a bit
shift (2 bits per meter). Seems logical to me, so it is probably correct.
Style guide: spacing and braces
Split send and receive sockets again

This is mainly in preparation of the coming redo of where we draw the radar image, but
I found that the HDS sends commands to the radar to port 6680 from port 6680, so might as
well imitate that.
Revise (auto)zoom strategy + chart scaling

This fixes two issues reported by Henning.

First of all, the automatic range calculation is now based on how much -would- fit on the
screen if the boat were in the center, plus 50%. This is what the plotters do as well.
This does mean that if you pan more than a bit the radar image border will be seen; previously
we'd zoom out the radar screen in order to attempt to illuminate any objects on the panned
screen.

Secondly, there was a bug that surfaced if you zoomed in and out. I think this is 4G specific,
which would explain why others haven't seen it. The 4G sends out up to 2048 different scan lines.
It looks as if it does not send out all scanlines on all ranges. If you zoomed from 4 km to 2 km
some of the scanlines would not be updated, and the range calculation which was
'select max(range) from scanlines' would still see a range of a scanline that would now no
longer be reported, and thus be stuck at 4 km. The quick fix is to just scale to the current
radar range, i.e. the last one received. This does mean that after a zoom some old scanlines
are zoomed incorrectly on the screen, but this can be fixed. I am not bothering now as this
will be refactored anyhow.
Version 1.40412
Merge branch 'master' of http://github.com/canboat/BR24radar_pi