tracing: only truncate ftrace files when O_TRUNC is set