Exit irust loop if line is nil.

This appears to trigger an exit if ctrl-d is pressed (tested locally).