Ensure ResourceIterator is properly closed.

CLA is signed.