Improve taskId detection in EsOutputFormat

Relates #280