avoiding NPE if writer was not created in StaxItemWriter