ftp/display: handle backspace crose lines

when user type a command cross several lines, the cursor needs to move up and
start from the end of the line.
ftp/display: consolidate debug message

make a static function for debug message
reformat the window size and position
print char in the debug log
ftp/display: scroll up the window when touch the bottom