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

Besides that, LGTM