add safety checks in init before calling delete

- init pwalletMain and pcoinsdbview to NULL
- add or extend NULL pointer checks before deleting any of pblocktree,
  pcoinsTip, pcoinsdbview or pwalletMain
- change a LogPrintf for nScriptCheckThreads from unsigned to %d as it is
  an integer