Fixed newline detection

When the console buffer was full, detection of an automatic line feed
stopped working, resulting in unwanted blank lines. The detection code
no longer relies on the console line number and this issue is now fixed.
Added a build.