Why does it closes when it has a next?

I think this is an unintended side effect that can be confusing and that doesn't follow most closeable APIs I've seen.