Rafael Nadal remains on course to extend his current French Open record to 10 titles after dispatching American Jack Sock – but not without some difficulty.