Process help and version arguments before datadir.

Parse command line parameters and process -help and -version before handling datadir directory in both bitcoind and bitcoin-cli. The home directory can be readonly, ~/.bitcoin can be a link to nowhere, etc. thus prevent displaying assertion to the user in such cases. This often happens to me, because I do have a full blockchain data on the removable disk. This also prevents the directory creation for new users who are running bitcoind for the first time (which is often considered as a bad practice in such cases).
This should fix #4059, #3639. See also #3640.