Enhance error handling for journal v2 migration (#21514)
* Improve metric deletion handling in migration and cache processing - Add checks to safely handle deleted metrics during page migration and cache operations. - Return NULL for invalid metric duplications in `mrg_metric_dup`. - Ensure proper resource cleanup and state marking when encountering deleted metrics. Enhance error handling for journal v2 migration: skip metrics with NULL UUID * Additional checks * Add null checks for `STORAGE_COLLECT_HANDLE` and reorganize `pdc` initialization logic - Safely return when `STORAGE_COLLECT_HANDLE` is null in key storage engine methods. - Reorder and streamline `pdc` initialization to avoid redundancy and improve clarity. * Add `pdc` cleanup in error path to prevent potential resource leaks * Add internal checks and cleanup logic to metric duplication error path * Validate UUID early in journal v2 migration and reduce redundancy in error paths - Add early UUID validity checks during metric migration to avoid unnecessary operations. - Adjust inflight query counters in `pagecache` on query completion for accurate tracking.