fix(streams): close the filedescriptor when the stream ends
emit an error if write is called after closed
whitespace fix
Merge pull request #472 from luvit/fix/stream_close

fix(streams): close the file descriptor when the stream ends