Flush input at every loop iteration.