LUCENE-1611: fix case where OutOfMemoryException in IndexWriter could cause infinite merging to happen