test: add missing closewrite call (#59356)
This test would previously just hang if there was any error, instead of
printing the error as intended.
This might be better as an IOBuffer so closewrite is implicit, but
that's behavior is not well-specified right now with multiple writers,
as is done here.