use semaphore to wait for CredUI completion