[Driver] Flush file in locked area
When writing report file by option -proc-stat-report some part of output
can be written to unlocked file because destructor of raw_fd_ostream
calls flush(). In high thread contention environment it can result in
file operation failure. With this change flush is called explicitly when
file is locked, so call of flush() in the destructor does not cause
write to file.