trace.cpp: last_flushed object wasn't properly protected by global file lock