In dry-run mode, create temporary files in a temporary directory

* src/util.c (make_tempfile): Do not create temporary files in the final output
directory when in dry-run mode: the path may be read-only.  In addition, we do
not want to leave intermediary empty output directories around.
Test case for the dry-run fix

* tests/create-directory: Add test case here.