Use randomly named file for temporay file

Use tempfile.mkstemp to generate temporary
file to avoid collision with an existing 'test'
file in /tmp.

Change-Id: Ic2f7f64ee9826afa6f04debd763e8c7a0eb25988
Fixes: bug #1213845