Make the various Writers member fields instead of local variables (#12446)

Change-Id: I9ca101edf6df41702b27635da9f749bdac5bf5f4