install: Always use a temporary file.
Previously, we would only use a temporary file if explicitly asked to
with the -S option, and even then, only if the target file already
existed. This meant that an outside observer looking for the target
file might see a partial file, and might see the file disappear and
then reappear.
With this patch, we always use a temporary file, ensuring atomicity.
The downside is slightly increased disk usage. The upside is never
having to worry about, for instance, cron jobs randomly failing if
they happen to run simultaneously with make installworld.
The -S option is retained, partly for compatibility, and partly
to control the use of fsync(2), which has a non-negligible cost
(approximately 10% increase in wall time for make installworld).
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: 0mp, brooks, imp, markj
Differential Revision: https://reviews.freebsd.org/D44742