auth/credentials: Improve memory handling in cli_credentials_set_machine_account