Fix terminal window size detection.

It now works properly when you have a repl_uart (assuming that
the repl-source stuff lands). I made it auto-detect if repl-source
is present.