Move timeout handling into serial.Read

Should use select rather than sleeping in a loop.