qt: Move initialization/shutdown to a thread

Move AppInit2 and Shutdown to a thread.

This allows a more responsive splash screen, prevents 'process does not respond'
messages from the window system and will allow for showing a user friendly
window while shutting down.
qt: Show window while shutting down

Makes it clear to the user that the application is still wrapping up
and the computer should not be turned off until it is finished.
qt: Remove global references in bitcoin.cpp

Remove the need for global references `guiref` and
`splashref` by making the BitcoinGUI and SplashScreen
classes register for the UI interface signals themselves.
qt: Stop shutdown detection timer during shutdown

Stop the shutdown timer from exiting the main loop
when shutdown is already in progress.

Fixes seeming hanging window after typing 'stop' in debug console.

Also hide the debug console during shutdown as it is useless without
a core to connect to.
Merge pull request #3493

9a2305a qt: Stop shutdown detection timer during shutdown (Wladimir J. van der Laan)
35ecf85 qt: Remove global references in bitcoin.cpp (Wladimir J. van der Laan)
55fe4de qt: Show window while shutting down (Wladimir J. van der Laan)
202d853 qt: Move initialization/shutdown to a thread (Wladimir J. van der Laan)
build: pass correct defs and include path to moc

To make sure the right slots are generated, MOC needs -DHAVE_CONFIG_H
and correct include path to include bitcoin-config.h.
GUI for --disable-wallet compiles and -disablewallet mode

There is not much in the GUI to be done without wallet,
though it's possible to change options, watch the sync process,
and use the debug console.

So embed the debug console in the main window.
Merge pull request #3392

b7f4b6d GUI for --disable-wallet compiles and -disablewallet mode (Wladimir J. van der Laan)
ec41342 build: pass correct defs and include path to moc (Wladimir J. van der Laan)