AdaMatch: A Unified Approach to Semi-Supervised Learning and Domain Adaptation