Connacht marked Andy Friend's final home game as their director of rugby with a 38-19 bonus-point win over Cardiff at the Sportsground.