Fix AppendIterator to properly handle empty child iterators.

AppendIterator also now rewinds child iterators before adding them.
This fixes #2595 and #2596