Fix infinite recursion in Writer impl for &mut Writer

Closes issue #17767