Make sure the instance is persisted before trying to get it's id

This is for https://github.com/pat/thinking-sphinx/issues/829. If a parent record has an after_save callback for a child index, the child isn't persisted yet, so the index.document_id_for_key(instance.id) throws a nil