the check_keypair function is called synchronized to ensure key is not uploaded twice by multiple threads.