Fix variable scoping issue that allowed timeouts to go undetected.
Correctly handle serial port read that receives more than one packet at a time.