Novak Djokovic has overcame an uncharacteristically unsteady start to avoid what would have been his earliest exit at Wimbledon since 2016