fix to ensure temp files are cleaned up on sucessful write to redshift (as well as postgres)