[SPARK-1341] [Streaming] Throttle BlockGenerator to limit rate of data consumption.

It would be great if you can modify this test slightly to make it strong. Can you try running a block interval 50 ms and a rate of 10 records / block interval . Then send records with a sleep of 1 ms. This means you are pushing at almost 50 records per block interval. Do this for multiple intervals, say for a wait time of the 1000 ms. Then the assert needs to check whether *every* block (in the `blockGeneratorListener.arrayBuffers`) has <= (maxRate * blockInterval / 1000)    records. This effectively tests that the rate is maintained across multiple blocks.