Azhar and Shafiq hit tons as Pakistan take control of decider