Moved dummy and port setup into main()...

Where it belongs to ensure that the custom exception handler gets to
deal with exceptions involving dummy and port setup.
Fixed all the multi-threading bugs

Eurgh. Lots of debug logging messages added, removed daemon status of
the dummy background thread (as it messed with the Qt GUI). Added a
thread Condition to guard the read-buffer of the dummy serial port.

This in turn allows easy synchronization of the dummy logger thread as
its serial port now calls wait() during its read() method, while the
data logger's port calls notify() during its write() method (and vice
versa) so the UI thread and dummy logger thread now play smoothly
together.