Rearranged flush stdout buffer