fix(kms): join surface threads before exit to avoid SIGABRT on shutdown