app: metadata undo: unref instead of free