Spark Integration: Collect System Metrics from Spark Job

Build running here: https://builds.cask.co/browse/CDAP-DUT176-5

@anew : Please review. Thanks. 
If you got exception when closing file, meaning the content may not get flushed correctly, shouldn't it be treated as an failure?