Study of the X-ray pulsar IGR J19294+1816 with NuSTAR: Detection of cyclotron line and transition to accretion from the cold disk