A supernova origin for dust in a high-redshift quasar