Headers-first synchronization

Many changes:
* Do not use 'getblocks', but 'getheaders', and use it to build a headers tree.
* Blocks are fetched in parallel from all available outbound peers, using a
  limited moving window. When one peer stalls the movement of the window, it is
  disconnected.
* No more orphan blocks. At all. We only ever request a block for which we have
  verified the headers, and store it to disk immediately. This means that a
  disk-fill attack would require PoW.
* Require protocol version 31800 for every peer (released in december 2010).
* No more syncnode (we sync from everyone we can, though limited to 1 during
  initial *headers* sync).
* Introduce some extra named constants, comments and asserts.

This breaks reindexing, which cannot yet deal with out-of-order blocks on disk.
RPC additions after headers-first
Remove CheckMinWork, as we always know all parent headers
Add CaughtUp() function (needed by later commits)
Improve getheaders (sending) logging
debug "block"
Use syncheight instead of startheight for broadcasting block invs
Better logging of stalling
Display error when duplicate block received
Only send initial getheaders when !CaughtUp()
Change check whether to send block inv after UpdateTip
Add height to "Requesting block" debug
Fix logic for nSyncStarted (only increases when headers actually arrive).
Request headers while we don't have the headers (fix to headersfirst8)
Improve getheader requests
sync: Add CTimeoutCondition

A condition that can wait for a specified timeout, this is useful when
it is known in advance that events have to be processed at some time in the
future.
net: add StartThreads and StopThreads signals

This allows modules to maintain their own threads.
net: Better inventory request management
Re-introduce mapAskFor (so that we don't waste getdata messages with only 1 inv in each one)
Improve getheaders (recv) logging