build: split the non-gui startup routines into a new file

This will allow each to have its own main(), meaning that we can build a common
base client and simply link in the correct startup object to create the
appropriate binary.

Conflicts:
	src/init.cpp
	src/makefile.linux-mingw
	src/makefile.mingw
	src/makefile.osx
	src/makefile.unix
build: add global var for whether or not the gui is enabled

Conflicts:
	src/main.cpp
	src/main.h
add missing Boost Thread join_all() call during shutdown

- fixes #3037 by adding missing join_all() call and brings bitcoind
  shutdown code in line with Bitcoin-Qt shutdown code
- added a comment for the if (!fRet) case

Conflicts:
	src/bitcoind.cpp