[matter] use collections.deque instead of lists, improve memory efficiency
[matter.builder] use vardb.match without cache, reduce memory usage
[matter.builder] use copy.deepcopy to copy more objects, avoid circular references
[matter.builder] add PackageBuilder.clear_caches()

This method is now responsible of clearing all the Portage and
Binary PMS caches.
[matter] use PackageBuilder.clear_caches()