Abdullah Shafique scored his third Test hundred, from 177 balls, on day three of the first Test against England in Rawalpindi.