Added rewind() method to cached streams to fix issue where the stream
position was wrongfully reset sometimes.