Djokovic puts down Federer fightback to reach final