[gh-229] Read line in a separate thread.

Don't block the event loop in the interactive mode.
Fix a merge bug (remove a debug print out from the test system).