Auto flush stdout

Signed-off-by: Zhao Xianghu <zhaoxh@ihep.ac.cn>