Re-implement lumi correction algorithm. Fix #5337

Do the lumi correction on the fly. Keep track of the already processed
lumis in a dict, and skip them it they were already encountered. Also,
keep track of the input files of the duplicated lumis, and add these input
files to the "original" job.