Make sure we always have a node to do IBD from

This introduces the concept of the 'sync node', which is the one we
asked for missing blocks. In case the sync node goes away, a new one
will be selected.

For now, the heuristic is very simple, but it can easily be extended
later to add better policies.

Conflicts:
	src/main.cpp
	src/net.cpp
Add bytessent, bytesrecv and syncnode to getpeerinfo

Conflicts:
	src/net.cpp
	src/net.h
	src/rpcnet.cpp
always show syncnode in getpeerinfo (fixes #2717)

Conflicts:
	src/rpcnet.cpp
Use pnode->nLastRecv as sync score directly

NodeSyncScore() should find the node which we recv data most recently, so put a negative sign to pnode->nLastRecv is indeed wrong.

Also change the return value type to int64_t.

Signed-off-by: Huang Le <4tarhl@gmail.com>