[SPARK-4631] unit test for MQTT

Please review the unit test for MQTT
Rather than hard coding "/tmp" and creating random files there ( and forgetting about them, thus creating garbage), please create a temporary directory in `before`, use it and then delete off the directory in `after`.