lib/stream: Add stream_discard, to discard read data from a stream

* stream.c: (stream_discard) Discard the already data from a stream, as
  indicated by the getp. Move remaining, unread data, to the beginning of
  the stream. get and end stream pointers are updated as appropriate.

  If all data has been consumed, then this behaves identically to
  stream_reset.
diff --git a/lib/stream.h b/lib/stream.h
index 06b0ee1..9127bcd 100644
--- a/lib/stream.h
+++ b/lib/stream.h
@@ -218,6 +218,8 @@
 
 /* reset the stream. See Note above */
 extern void stream_reset (struct stream *);
+/* move unread data to start of stream, discarding read data */
+extern void stream_discard (struct stream *);
 extern int stream_flush (struct stream *, int);
 extern int stream_empty (struct stream *); /* is the stream empty? */