Write string/buffer to a random temp file