[matter] use copy.deepcopy with Portage Package.pkg objects to avoid leaks