Datta-Das-type spin-field-effect transistor in the nonballistic regime