File storage should write tokens to tmp file then cp when write finishes