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