Only start the identity-file-writer if managing state.

Same fix as in master.