Split get_bit() into get_bit_file() and get_bit_live().

Remove some dead code and trap case when count is unitialized.
Use GETBIT_EOD (via 'Q') to exit from live mode and rewrite if statements as a switch.
Whitespace fix.
Add a new function write_new_logfile(), split off from set_mode()
Split set_mode() into set_mode_live() and set_mode_file()

Note that the new set_mode_*() functions do not initialize the log file.
Remove now unused variable "islive"
Restore log file functionality

Instead of using the '-l' parameter it is now read from config.txt (if
present). The future 'L' key can be used to temporarily change or
enable/disable the log file.

Convert a single case+default switch into an if/else
errno is undefined here, return 1 instead of errors
errno is undefined here, so print an error message ourselves.
Allow keys with empty values, but not the other way around.
Reset "light" when frequency is OK again.
Use no logfile by default (like before), but add an empty entry to please read_config_file().
Compact frequency reset code (and actually reset the flag).
Drop 'w' which never changed from 0.05 anyway, replace it by '0.05' instead.
Drop some unneeded curly braces.
Fix a bug which would exit the loop too early, causing "count" to remain -1.