Stay connected to seed nodes; disconnecting causes problems if you are trying to make the initial blockchain download.

Backported from bitcoin commit b53e277ba12e011287d3b15823b64c303ab66243
Fix indent
Retain only the most recent time samples

Remembering all time samples makes nTimeOffset slow to respond to
system clock corrections.  For instance, I start my node with a system
clock that's 30 minutes slow and run it for a few days.  During that
time, I accumulate 10,000 offset samples with a median of 1800
seconds.  Now I correct my system clock.  Without this change, my node
must collect another 10,000 samples before nTimeOffset is correct
again.  With this change, I must only accumulate 100 samples to
correct the offset.

Storing unlimited time samples also allows an attacker with many IP
addresses (ex, a large botnet) to perform a memory exhaustion attack
against Bitcoin nodes.  The attacker sends a version message from each
IP to his target, consuming more of the target's memory each time.
Time samples are small, so this attack might be impractical under the
old code, but it's impossible with the new code.

Backported from bitcoin commit 1c4aab926e0b25e0c896d4703d858eda1eb14ea5
Give peer time-adjustment data an own lock

Instead of relying on cs_main (defined in a different module) to
prevent concurrent access to it.

Backported from bitcoin commit a616206865d62106944300d7b912e3af8d357610