exec, file: set umask before mkstemp

Set umask so that temp files are created with
permissions 0600.

Courtesy of coverity.

Signed-off-by: Steve Bennett <steveb@workware.net.au>