Use while loops instead of for loops in recurrent.py.
Use while loops instead of for loops in recurrent.py.

This prepares for adding the ability to use custom terminating conditions.

Based on steps/s summaries, there is a ~10% reduction in performance on GPU and no difference in performance on TPU.

PiperOrigin-RevId: 232046924

tensorflow/lingvo,tensorflow/lingvo,tensorflow/lingvo,tensorflow/lingvo