SPARK-2134: Report metrics before application finishes

Alright, sounds fine.