Create persistent task files safely Use a temporary directory to create the files in first to avoid partially written files being exposed in the waiting directory. Change-Id: I82222e16b52926ced304cb24eadd1c8d56cf9a7a