MAPREDUCE-430. Fix bug related to Task getting stuck due to OutOfMemoryErrors. Contributed by Amar Kamat.