Include undo data to startup checks and refactor them onto a function.

The check is now simpler, somewhat more efficient, and
covers more data, to be sure the node can reorganize.
Add a switch to allow the node to run in a pruned state

These are the main functional changes on this state:

* The node is prevented to run with a wallet.
* Check for data at startup is limited to last 288 blocks.
* NODE_NETWORK flag is unset.
* Requests for pruned blocks from other peers are ignored.
Check presence of required data on all active chain and fix status flags.

BLOCK_HAVE_DATA is replaced by BLOCK_DATA_PRUNED on blocks which have his data missing,
and BLOCK_HAVE_UNDO for BLOCK_DATA_PRUNED for missing undo data.
Implement autoprune
Log range of blocks pruned.