[NF] Write text from a variable (e.g. configuration data) to a file in an atomic way.