Exeter Chiefs recorded a 47-38 victory over Harlequins, ending a tough season on a high note at home.