Create files safely when mktemp is not available.