Creates a new SafeMetadata by taking ownership of the given metadata. The provided metadata should not be used after calling this method.