fix(streams): close the filedescriptor when the stream ends