Use renameat2() to atomically exchange metadata on metadata regenerate
When using shm-path, a use-case is to expect the sessiond or the system to crash at any point during tracing.
If such a crash occurs while regenerating the metadata, lttng-crash may find a truncated file.
It would be nice if we could generate the new metadata in a ".metadata.new" file while keeping the old file around, and then exchange both files using renameat2().
However, renameat2() appeared in kernel 3.15, so we would have to figure out a fallback.