Enhance tools/readserial.py to support reading from a pipe.