Verify writer exists before attempting to close