Using WaitForMultipleObjects now to reduce CPU load.
Fixed resource leaks.
Fixed resource leaks and missing thread sync.
Fixed high CPU usage.
Fixed invalid access to tty in thread, which was already removed by
serial_process_irp_close
Retry read now, if non blocking IO returns EAGAIN.
Removed EAGAIN handling, again passing on the error to the server.
Merge pull request #1422 from akallabeth/serial_event_fix

Serial event fix and resource leakage fixes