flush stdout immediately