restructure main()

- factor out option parsing and curses initialization
- defer color initialisation until logcfg.dat is read
- factor out loading of databases
- minor fixes to failure handling
- factor out initialisation of hamlib, packet and lan connection
- factor out initialisation of keyer device
add correct deinitialisation of RTTY controller