Fixes: #1345
The actual problem is that GetDataDir has the side effect of creating the
datadir, even if it is not known yet where it really is. This is only
known after reading the config file or when explicitly specified in the
cmd line.
Thus, if GetDataDir gets called before the datadir value from the config
is read, it tries to create it at the default location.
* Fix exit codes:
- `--help`, `--version` etc should exit with `0` i.e. no error ("not enough args" case should still trigger an error)
- error reading config file should exit with error
- slightly refactor AppInitRPC/AppInitRawTx to return standard exit codes (EXIT_FAILURE/EXIT_SUCCESS) or CONTINUE_EXECUTION (-1)
- every main()/exit() should return/use one of EXIT_ codes instead of magic numbers