logging.cpp: Flush stdout after writing to ensure writing when redirected to a file

Change-Id: I626f1eabafa145b283a62fa45108ab7da6baf7e5