Novak Djokovic draws level with Australian Margaret Court on 24 major singles titles by outlasting Daniil Medvedev in a punishing US Open final.