Use temp dir to generate temp report on impact merge dialog.

Regarding resources issue https://github.com/AIFDR/inasafe/pull/861, it will generate the resources needed for impact merge tools on the output directory that is selected by user. I changed it to use temp dir instead.

And some coding standards on temp_dir function itself.

Functionally tested