Flush stdio to prevent buffering multiple debugging messages when redirecting output to file.