Prepare for inclusion in Cyphesis too.

We want the export and import code to work the same way in both
Cyphesis and Ember, so we are to gain if most of the code can be kept the same.
Wait until all thoughts have been received.

If we quit before all thoughts have been processed there's a risk that
these will be cancelled by the server.