Attempt to flush the export entities sooner

Also, call ->clear() on the entity manager regularly