unlink the temporary file immediately after calling mkstemp
fill-in `data_stat` after copying the request entity into the temporary file