[stream] Remove write_contents

The ring will now read the stream contents and write it out itself.
Makes stream implementation(s) easier.
[stream] Use -1, not 0, as "not opened yet"

As suggested by ChPe.
[stream] Fix warnings
Bug 676075 - Incorrect scrollbar position after the "less" command

Patch from Egmont Koblinger.