Fixed some bugs in FileStream and Stream/TextReader

Mostly potential null pointer exceptions but also some fixes for bugs
when working with the backing buffer.

Also just as a note. FileStreams currently truncate the file when opened
too write. Working on a fix.