Frankie Dettori's final race was a victory in Brazil: "Thank you all, I lived a dream."