migrate_extrinsic_metadata: retry in case of database errors.
They are likely to happen since this script takes a long time to run.