[sf] write transaction trace to disk on error

Flush always on transaction traces to disk when we detect
errors like: - out of order buffer updates or cycles in
the layer hierarchy so it easier to investigate issues
from dogfood (ref bug b/272189296)

Bug: 282110579, 238781169
Fixes: 277265947
Test: presubmit

Change-Id: I22dbd7cd43d94763ac941f0c3871dc7e4ea8db8d
8 files changed