[SPARK-4631] unit test for MQTT

Please review the unit test for MQTT
rdd.first can throw error if there are not records in the rdd. If by chance, the first batch in this program does not have the published data and returns an empty RDD, there are hidden exceptions made which is recipe for failures in the future - flaky tests, etc. As I said earlier, see the KafkaStreamSuite for inspiration. It does a RDD.collect() and puts all the received data into a hashmap (could be a simple buffer/list in your case). Then the eventually verifies the data in the buffer.