tests: janitorial: factor named temp file creation

A common pattern in the testsuite is to create a named
temporary entry in the filesystem, optionally filled
with test data and, less commonly,  with adjusted permissions.

This patch refactor this behaviour in an handy context manager,
named temporaryPath, which also ensures entries are deleted when
no longer needed.

It is worth to point out that the usage of this context manager
can be at least partially replaced with tempfile.NamedTemporyPath;
If it's the case, this will be addressed in a future patch.

PatchSet V2:
- fix rebasing

PatchSet V3:
- always cleanup the temporary path, even in presence of exceptions.

Change-Id: Iddfb6b74f0792e234d58549c6da8fb2ddb5e72fd
Signed-off-by: Francesco Romani <fromani@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/22379
Reviewed-by: Dan Kenigsberg <danken@redhat.com>