Fix up/down arrow key in text field

Fix issue #22 (same as Debian bug #603067), where up/down arrow would
always send cursor to the first line in text field.