Write fee estimate and peers files only when initialized

Fixes #4669.

Move the loading of addresses to StartNode() to make it more
self-contained.
Reserve only one network specific cached path per session
Remove CBaseChainParams::NetworkID()
Use ModifyCoins instead of mutable GetCoins.

Replace the mutable non-copying GetCoins method with a ModifyCoins, which
returns an encapsulated iterator, so we can keep track of concurrent
modifications (as iterators can be invalidated by those) and run cleanup
code after a modification is finished.

This also removes the overloading of the 'GetCoins' name.
Get rid of CCoinsView's SetCoins and SetBestBlock.

All direct modifications are now done through ModifyCoins, and BatchWrite is
used for pushing batches of queued modifications up, so we don't need the
low-level SetCoins and SetBestBlock anymore in the top-level CCoinsView class.
Do not keep fully spent but unwritten CCoins entries cached.

Instead of storing CCoins entries directly in CCoinsMap, store a CCoinsCacheEntry
which additionally keeps track of whether a particular entry is:
* dirty: potentially different from its parent view.
* fresh: the parent view is known to not have a non-pruned version.

This allows us to skip non-dirty cache entries when pushing batches of changes up,
and to remove CCoins entries about transactions that are fully spent before the
parent cache learns about them.
Add coins_tests with a large randomized CCoinViewCache test.
Get rid of the dummy CCoinsViewCache constructor arg
fix a possible memory leak in CWalletDB::Recover

- convert pdbCopy into a boost::scoped_ptr to ensure memory gets freed
  in all cases (e.g. after "ret > 0")
fix possible memory leaks in CWallet::EncryptWallet

- add missing deletes for pwalletdbEncryption
- add an assert before trying to reserve memory for pwalletdbEncryption
- add a destructor to CWallet, which ensures deletion of
  pwalletdbEncryption on object destruction
change exit(1) to an assert in CWallet::EncryptWallet
Qt: allow "emergency" shutdown during startup

- allows closing our splash screen to abort startup
[Wallet] Watch-only fixes
Keep information about all block files in memory
add -timeout default as constant and use them

- update help message text
- simplify code in init to check for -timeout
contrib: use batched JSON-RPC in linarize-hashes

Batch up to 10000 requests for a ~30x speedup.
contrib: make linearize-data.py cope with out-of-order blocks

Make it possible to read blocks in any order. This will be required
after headers-first (#4468), so should be merged before that.

- Read block header. For expected blocks, continue, else skip.
- For in-order blocks: copy block contents directly. Write prior
  out-of-order blocks if this connects a consecutive span.
- For out-of-order blocks, store extents of block data for later
  retrieval. Cache out-of-order blocks in memory up to 100MB
  (configurable).
Prettify JSON tests and minimize diffs
Merge pull request #5050

772ab0e contrib: use batched JSON-RPC in linarize-hashes (Wladimir J. van der Laan)
Merge pull request #5055

2c930d9 Prettify JSON tests and minimize diffs (Pieter Wuille)