StateMachine.dump produces no output sometimes.

If the content to dump is large no output is produced by dump. Change
back to using a loop and flush.

Bug: 18965342
Change-Id: Ibc33da8bfffd5f998a78df0e2d70ed8e8a0aa137
1 file changed