Add StatefulIterator, fix bug in DataCallbackIterator.