main.cpp: disable buffering on stdin and stdout