ed.py: separate non-blocking ed_cmd function out of ed function
ed_cmd processes one input line in ed command or input mode