Fix import indexing issues

* In some cases, objects can exist in both `session.new` and
  `session.dirty`, so ensure we don't try to create duplicate index
  records.