Adaptive Learn-then-Test: Statistically Valid and Efficient Hyperparameter Selection