Handle sandbox provider preferences and fix DB queries
Use canonical sandboxes.id for lookups and deletions, selecting the
record before removing provider auth entries. Wrap provider save
transaction with try/catch, log failures and throw an XRPCError on
failure. Return provider prefs with explicit $type in the API.
Add preferences API and React hooks; load/save provider preferences in
the settings UI, seal API keys client-side (and store a redacted copy),
and show success/error notifications on save.