DEV: Do not destroy external upload stub on error in debug mode (PR #14139)

We do not want to destroy the external upload stub records in debug mode because they allow for investigation of problems occuring.

GitHub