Previously, altering metadata could only be done rewriting the
file (or with a tempfile with the assumption the tempfile would
replace the existing file). However, there are good reasons to
write a new file instead. One API call is added for that, and
one is changed to enable this.