Extract common code for cache purging

This issue is to extract the common code between Maven and Container Virtual registries around cache entry purging:

  1. purge_cache! we have similarities in Container and Maven (see ee/app/models/virtual_registries/packages/maven/registry.rb#purge_cache!). Extract for reuse.
  2. MarkEntriesForDestructionWorker - ee/app/workers/virtual_registries/container/cache/mark_entries_for_destruction_worker.rb` we also have some similarities here and an opportunity to extract the common code.

Reference: !213785 (comment 2915119262)

Edited by 🤖 GitLab Bot 🤖