Cook and Root keep Pakistan at bay