[SPARK-4707][STREAMING] Reliable Kafka Receiver can lose data if the blo...

...ck generator fails to store data.

The Reliable Kafka Receiver commits offsets only when events are actually stored, which ensures that on restart we will actually start where we left off. But if the failure happens in the store() call, and the block generator reports an error the receiver does not do anything and will continue reading from the current offset and not the last commit. This means that messages between the last commit and the current offset will be lost.

This PR retries the store call four times and then stops the receiver with an error message and the last exception that was received from the store.
In general, the failures probably are transient. Example, HDFS hflush fails because of GC or replication fails to the second BM because of timeouts or something. Such issues are likely to succeed on retries, but any major ones won't -- so limited retry followed by failures is probably a reasonable approach without making things too complex.