More quickly call close in HadoopRDD.

This also refactors out the common "gotNext" iterator pattern into
a shared utility class.
Forgot equals.
Remove NextIterator.close default implementation.
Add NextIterator.closeIfNeeded.
Add a test for NextIterator.
Merge pull request #521 from stephenh/earlyclose

Close the reader in HadoopRDD as soon as iteration end.