Check for correct genesis

At startup, check that the expected genesis is loaded. This should prevent
cases where accidentally a datadir from the wrong network is loaded
(testnet vs mainnet, e.g.).
Merge pull request #2642 from sipa/rightgenesis

Check for correct genesis