add GetRandBytes() as wrapper for RAND_bytes()

- add a small wrapper in util around RAND_bytes() and replace with
  GetRandBytes() in the code to log errors from calling RAND_bytes()
- remove OpenSSL header rand.h where no longer needed
move rand functions from util to new random.h/.cpp
make RandAddSeed() use OPENSSL_cleanse()

- removes the cstring include and is also used in RandAddSeedPerfmon()
Introduce whitelisted peers.

This adds a -whitelist option to specify subnet ranges from which peers
that connect are whitelisted. In addition, there is a -whitebind option
which works like -bind, except peers connecting to it are also
whitelisted (allowing a separate listen port for trusted connections).

Being whitelisted has two effects (for now):
* They are immune to DoS disconnection/banning.
* Transactions they broadcast (which are valid) are always relayed,
  even if they were already in the mempool. This means that a node
  can function as a gateway for a local network, and that rebroadcasts
  from the local network will work as expected.

Whitelisting replaces the magic exemption localhost had for DoS
disconnection (local addresses are still never banned, though), which
implied hidden service connects (from a localhost Tor node) were
incorrectly immune to DoS disconnection as well. This old
behaviour is removed for that reason, but can be restored using
-whitelist=127.0.0.1 or -whitelist=::1 can be specified. -whitebind
is safer to use in case non-trusted localhost connections are expected
(like hidden services).
getblocktemplate: longpolling support
Add test for getblocktemplate longpolling
Do not flush the cache after every block outside of IBD
-datadir is now allowed in config files
In -? output: -keypool, -gen, -genproclimit depend on ENABLE_WALLET
Clarify that redeemScript is often optional
Merge pull request #4511

a7e1d50 In -? output: -keypool, -gen, -genproclimit depend on ENABLE_WALLET (Zak Wilcox)
[Qt] Fix segfault when launched with -disablewallet
[Qt] Fix No such slot UnitDisplayStatusBarControl::onDisplayUnitsClicked
Fix Watchonly: cs_main lock not held
Merge pull request #4519

e3496da [Qt] Fix No such slot UnitDisplayStatusBarControl::onDisplayUnitsClicked (Cozz Lovan)
Merge pull request #4510

6b407e4 -datadir is now allowed in config files (Zak Wilcox)
Merge pull request #4503

b45a6e8 Add test for getblocktemplate longpolling (Wladimir J. van der Laan)
ff6a7af getblocktemplate: longpolling support (Luke Dashjr)
Merge pull request #4520

39cc492 Fix Watchonly: cs_main lock not held (Cozz Lovan)
Merge pull request #4378

dc942e6 Introduce whitelisted peers. (Pieter Wuille)
qt: Ignore showNormalIfMinimized in initialization or shutdown

Also get rid of ui_interface flag NOSHOWGUI. It's up to the GUI to
decide this.

Fixes #4360.