[SPARK-2379] Fix the bug that streaming's receiver may fall into a dead loop