build: quit abusing LIBS for Windows builds.

Similar to the INCLUDES changes in 6b099402b40, split out LIBS into individual
entries for more fine-grained control.

Also add MINIUPNPC_LIBS which was missing before, and hook it up to
executables.
build: fix libtool's refusal to link static libs into a dll
rpc: Fix leveldb iterator leak, and flush before `gettxoutsetinfo`

This fixes an iterator leak resulting in

    bitcoind: db/version_set.cc:789: leveldb::VersionSet::~VersionSet(): Assertion `dummy_versions_.next_ == &dummy_versions_' failed."

exception on shutdown.

Also make sure to flush pcoinsTip before calling GetStats() to make
sure we apply them to the current height.
boost: split stream classes out of serialize.h

serialization now has no dependencies.
Update license in pull-tester and rpc-tests

Add missing copyright/license header where necessary
getblockhash: throw JSONRPCError (not runtime_error)
Merge pull request #5134

6261e6e getblockhash: throw JSONRPCError (not runtime_error) (dexX7)
Merge pull request #5115

33dfbf5 rpc: Fix leveldb iterator leak, and flush before `gettxoutsetinfo` (Wladimir J. van der Laan)
Merge pull request #5119

fa73619 boost: split stream classes out of serialize.h (Cory Fields)
Merge pull request #5086

1723862 build: fix libtool's refusal to link static libs into a dll (Cory Fields)
28d412f build: quit abusing LIBS for Windows builds. (Cory Fields)
Build util and common before building server
Merge pull request #5112

071473c Build util and common before building server (jtimon)
Merge pull request #5121

214091d Update license in pull-tester and rpc-tests (Michael Ford)
Create new BlockPolicyEstimator for fee estimates

This class groups transactions that have been confirmed in blocks into buckets, based on either their fee or their priority.  Then for each bucket, the class calculates what percentage of the transactions were confirmed within various numbers of blocks.  It does this by keeping an exponentially decaying moving history for each bucket and confirm block count of the percentage of transactions in that bucket that were confirmed within that number of blocks.

Also eliminate txs which weren't clear at entry from fee/pri calcs
Remove CMinerPolicyEstimator and CBlockAverage code
New smartfees.py and associated funcs in util.py