flush stdout immediately
fix a bug that line break behaves differently at different platform