49ers use defense, Deebo Samuel to beat Rams 24-9