A teenager who caused a head-on collision that killed an unborn baby has avoided detention in a landmark sentencing.