Use hand-rolled wrapping for curses mode as well.

Relying on curses to wrap seems to produce off by one errors in the cursor
position.