Pakistan take the wickets of Jordan Cox and Joe Root in quick succession as they halted England's advances on day two at Headingley.