Fixed a potential bug in reading data from SerialPort
"Random" data in the buffer could cause and overflow and resulting exception to be thrown when starting to read data.