Merge pull request #191 from m4r71n/pr-fix_windows_build

fix windows build
Defer deletion of socket and add more debug logging
Windows: Fix console part of application

Create process and redirect stdin, stdout and stderr in new thread.
Windows: Check if stdin has data before reading
Removed stray character in about dialog
Use counter for opened sockets instead of counting child sockets
Keep texts and shortcuts untranslated in tests
Back up application settings and restore if empty
X11: Allow to autostart different sessions
Resize tab tree if an item is collapsed or expanded
Removed defects found by Coverity
Scriptable: Don't check clipboard too aggressively on copy()
Windows: Use monospaced font for defining commands
Rename custom sleep() function
Try to use system monospace font for defining user command
Set session name from environment variable for user commands

Default session name is taken from COPYQ_SESSION_NAME enviroment
variable. Arguments for "copyq" in user commands don't have to be
modified and user can still override session name from command line.
COPYQ_LOG_LEVEL env variable to control log verbosity

Set COPYQ_LOG_LEVEL environment variable to control verbosity of
messages printed on stderr.

COPYQ_LOG_LEVEL can be one of following:

    TRACE   - print trace messages (very verbose debug)
    DEBUG   - print debug messages, default for debug build
    NOTE    - print notes, default for release build
    WARNING - print warnings
    ERROR   - print errors

If COPYQ_LOG_LEVEL is set to a level, all log levels below that level
are also printed. For example, if COPYQ_LOG_LEVEL=NOTE, messages for
NOTE, WARNING and ERROR log level are printed.
COPYQ_LOG_FILE env variable for log file name

If COPYQ_LOG_FILE environment variable is set, its value is used as file
name for logging instead of stderr.

Using this variable allows the monitor process to use the log file too.
Tests: Fix flush ID check
Fix date format in log