BufferedDocumentIndex - bugfix: flush buffer when catching an exception