Continuum limits and exact finite-size-scaling functions for one-dimensionalO(N)-invariant spin models