Update our copy of the new export API

Applies @dllh's fix for orphaned terms. See https://core.trac.wordpress.org/ticket/22435#comment:38