Dominic Thiem converted his sixth match point in a final set tie-break to beat Novak Djokovic, and reach the showpiece of the ATP Finals for the second year in a row.