Make ModelTest happy.
Do not modify internal data structures before calling beginInsertRows.

This fixes triggering an assert in index(), as well as misbehavior in
QSortFilterProxyModel.