Race condition: exception while closing the river

It could happen in some extreme conditions that when closing the river, some documents are still on the way to be processed. It generates an `ElasticsearchIllegalStateException`.

Instead, we now skip the line being processing and add a `WARN` in logs.

 Closes #66.

(cherry picked from commit 9e83297)
(cherry picked from commit 41a702a)