fix qtconsole history logic for end-of-line

EndOfLine may or may not mean the end of a full line when the line is longer than the window.
This commit uses the same logic to check as the actual move, so it should be consistent.

closes #2943
wrong cursor
Merge pull request #2946 from minrk/qteol

fix qtconsole history logic for end-of-line