Novak Djokovic claimed the all-time record for most men's singles match wins at Wimbledon, but had to overcome moments of visible frustration to beat qualifier Roman Safiullin and reach the quarter-finals.