Replace tempfile with mktemp

Change-Id: I83d69ee0df5bd19682a6a9eb8d8498a59bdab81a
Merge "Replace tempfile with mktemp"