make couchexport more surgical about not leaving temp files around

handful of semi-related changes to better clean up files.

in response to http://manage.dimagi.com/default.asp?123162 and http://manage.dimagi.com/default.asp?102956
It looks like it won't delete files if there's a `SchemaMismatchException`, but that's probably fine.