Fixed initialization of serial device, now aborting pending
read / write operations.
Fixed compilation error, now using WaitForMultipleObjects.
Fixed check for _GNU_SOURCE pthread extensions.
Reset file descriptor set only, if necessary now.
Using a monitor thread for tty input now to work around a WaitForMultipleObjects
limitation of winpr.
Using infinite timeout now in threads to reduce CPU usage to nearly zero.
Merge pull request #1429 from akallabeth/serial_init_fix

Serial port and CMake magic fixes