Optimize iterators

Simple updates. 1) Always Close() an interator when replaced, and 2) Give TripleStore a chance to optimize things.