DS-1554 fix and related preventive fixes

* make SWORD use upload.temp.dir
* Also make sure that it's not null
* if upload dir is not specified, use java.io.tmpdir