Allow Mac linebreaks in shell

QEMU uses Mac style newlines in its UART implementation.
This change allows Unix ("\n"), DOS ("\r\n") and Mac ("\r") style
linebreaks.