Improve detection of Hadoop taskID

Hadoop 2.5.x introduced a bug where the task attempt is used for the
task id. To cope around this, the code searches first for the task
attempt and only then falls back to the task id.

relates #280

(cherry picked from commit a2084e2a9652c5d956239584184dcb2becf9c99d)