Make sure Enumerator.close() is always called.