CB-7512: Fix logic for detecting SDK directory