Fix compile warning and timeout message logic in io_stream.c