stream: file: Use O_TMPFILE when available

https://bugzilla.gnome.org/show_bug.cgi?id=704705
Bug 415277 - Garbage displayed after resizing whilst using an alternate screen

Patch from Egmont Koblinger.
Part of Bug 646098 - vte uses too many file descriptors

Patch from Egmont Koblinger, from comment 13.
[stream] Add API to get start-of-page offsets

For previous behavior of the _vte_stream_head() api, add
index=0 to the new function.
[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.
[stream] Finish off commit 2cf872c90d85163f297e3a0fd56866a29849e0bf
[stream] Remove unused includes
[stream] More fixups

Towards an abstract file descriptor.