Car dealer group Sonic Automotive has posted a 39% rise in quarterly earnings, boosted by cost improvements and growth in all its business units.