[SPARK-4062][Streaming]Add ReliableKafkaReceiver in Spark Streaming Kafka connector

Add ReliableKafkaReceiver in Kafka connector to prevent data loss if WAL in Spark Streaming is enabled. Details and design doc can be seen in [SPARK-4062](https://issues.apache.org/jira/browse/SPARK-4062).
Aaaah, I get it but this is soooo non-intuitive. That synchronized is no in this file. This is a hard logic to understand. Maybe we should separate out the locked functionality into two locks. The lock of the BlockGenerator is used to replace the ArrayBuffer in the BlockGenerator, and in the ReliableKafkaReceiver, another lock is used to update the offsets. Even though there are two locks, thats a cleaner design as there is a clean separation of functionality in the locks - the BlockGenerator lock does not need to be concerned with the Receiver lock, and the Receiver lock should not have to worry about locks in BlockGenerator (as long as deadlock is avoided). To avoid deadlocks, the callbacks should not be called from within synchornized sections in the BlockGenerator.